Table of Contents

Class ParameterizedFlagSyntax

Namespace
Hi.Numerical.SoftParsers.SyntaxBased
Assembly
HiMech.dll

Syntax for flags with attached parameters (e.g., G54.1P1, G10L2P1). Note that the ParameterizedFlagSyntax often should be applied before NumberedFlagSyntax since NumberedFlagSyntax may eat the text that ParameterizedFlagSyntax should handle.

public class ParameterizedFlagSyntax : INcSyntax
Inheritance
ParameterizedFlagSyntax
Implements
Inherited Members
Extension Methods

Remarks

Examples:

  • G54.1P1 → {"G54.1": {"P": "1"}}
  • G10L2P1 → {"G10": {"L": "2", "P": "1"}}
  • G54.1P#1 → {"G54.1": {"P": "#1"}} (Fanuc variable)
  • G54.1PQ1 → {"G54.1": {"P": "Q1"}} (Heidenhain variable)

Constructors

ParameterizedFlagSyntax(IEnumerable<string>, IEnumerable<string>, IEnumerable<string>, string, IEnumerable<string>)

Creates a new ParameterizedFlagSyntax instance.

public ParameterizedFlagSyntax(IEnumerable<string> categoryPath, IEnumerable<string> codePrefixes, IEnumerable<string> paramPrefixes, string varPrefix, IEnumerable<string> terminateWords = null)

Parameters

categoryPath IEnumerable<string>

JSON path for storing matched codes.

codePrefixes IEnumerable<string>

Full code prefixes to match (e.g., [“G54.1”, “G10”]).

paramPrefixes IEnumerable<string>

Parameter prefixes to extract (e.g., [“P”, “L”]).

varPrefix string

Variable prefix (e.g., “#” for Fanuc, “Q” for Heidenhain).

terminateWords IEnumerable<string>

Words that stop parameter extraction.

Properties

CategoryPath

Category path for storing matched codes in JSON.

public List<string> CategoryPath { get; set; }

Property Value

List<string>

CodePrefixes

Full code prefixes to match (e.g., [“G54.1”, “G10”]).

public List<string> CodePrefixes { get; set; }

Property Value

List<string>

Name

public string Name { get; }

Property Value

string

ParamPrefixes

Parameter prefixes to extract (e.g., [“P”, “L”, “H”]). Multiple parameters can be attached to one code.

public List<string> ParamPrefixes { get; set; }

Property Value

List<string>

TerminateWords

Words that terminate parameter extraction (e.g., [“G”, “M”, “X”, “Y”, “Z”]). Extraction stops when encountering these prefixes followed by a number.

public List<string> TerminateWords { get; set; }

Property Value

List<string>

VarPrefix

Variable prefix for macro variables (e.g., “#” for Fanuc, “Q” for Heidenhain).

public string VarPrefix { get; set; }

Property Value

string

Methods

ToArranged(JsonObject)

Get arranged json from src.

public JsonObject ToArranged(JsonObject src)

Parameters

src JsonObject

Returns

JsonObject