Class NumberedFlagSyntax
- Namespace
- Hi.Numerical.SoftParsers.SyntaxBased
- Assembly
- HiMech.dll
Syntax for numbered flags (prefix + number) with optional decimal support. NumberedFlagSyntax often should place after something like ParameterizedFlagSyntax. Since NumberedFlagSyntax is easy to eat those kind of flags.
public class NumberedFlagSyntax : INcSyntax
- Inheritance
-
NumberedFlagSyntax
- Implements
- Inherited Members
- Extension Methods
Remarks
Examples:
- Integer codes: G0, G1, G54, M3, M30, T5, S1000
- Decimal codes: G54.1 (Fanuc extended work coordinates)
Constructors
NumberedFlagSyntax(IEnumerable<string>, IEnumerable<string>, bool)
Creates a new NumberedFlagSyntax instance.
public NumberedFlagSyntax(IEnumerable<string> categoryPath, IEnumerable<string> codePrefixes, bool allowDecimal = true)
Parameters
categoryPathIEnumerable<string>JSON path for storing matched codes.
codePrefixesIEnumerable<string>Code prefixes to match (e.g., [“G”, “M”]).
allowDecimalboolWhether to allow decimal numbers.
Properties
AllowDecimal
Whether to allow decimal numbers (e.g., G54.1).
public bool AllowDecimal { get; set; }
Property Value
CategoryPath
Category path for storing matched codes in JSON.
public List<string> CategoryPath { get; set; }
Property Value
CodePrefixes
Code prefixes to match (e.g., [“G”, “M”]).
public List<string> CodePrefixes { get; set; }
Property Value
Name
public string Name { get; }
Property Value
Methods
ToArranged(JsonObject)
Get arranged json from src.
public JsonObject ToArranged(JsonObject src)
Parameters
srcJsonObject