Table of Contents

Class SiemensCycleCallSyntax

Namespace
Hi.NcParsers.ParsingSyntaxs.Siemens
Assembly
HiMech.dll

Captures whitelisted Siemens cycle calls of the shape NAME(arg1,arg2,…) (or the bare NAME form) from the unparsed line text into a Parsing.NAME sub-object holding the verbatim positional argument strings: CYCLE832(0.05,_ORI_FINISH,0.8)Parsing.CYCLE832 = { “Args”: [“0.05”, “_ORI_FINISH”, “0.8”] }. Empty slots (,,) stay as empty strings; NAME() yields an empty Args array; a bare NAME yields { “Bare”: true } (a marker — empty sub-objects would be swept by intermediate CleanupParsing calls before the consumer runs). A brand Logic syntax consumes the sub-object (e.g. SiemensPathSmoothingSyntax for CYCLE832, SiemensCycle800TiltSyntax for CYCLE800).

Strictly whitelist-based (CycleNames, default CYCLE832 + CYCLE800) — a generic WORD(args) capture would eat OEM/unknown calls (HQ_FC(...), L_39(...)) whose safe-skip handling is a separate work item, and every unlisted call deliberately stays whole in UnparsedText for the visible UnparsedText--Remaining warning.

Must be placed early in the Parsing bundle — before the assignment and tag-value syntaxes: argument tokens standing after ( or , (_ORI_FINISH, or axis-letter shapes like V1) would otherwise be shredded by NamedVarAssignmentSyntax / tag-value captures. Quoted arguments are supported for CYCLE800's swivel-data-record name (CYCLE800(1,"TC1",…)): the args body admits complete "…" runs (which may hide ) or ,) and the comma split is quote-aware; quotes are kept verbatim in the captured arg string so the consumer distinguishes "0" (name) from 0 (number). A line whose quotes do not pair falls through whole to SiemensQuotedStatementSyntax's quarantine.

public class SiemensCycleCallSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
Inheritance
SiemensCycleCallSyntax
Implements
Inherited Members
Extension Methods

Examples

Full arm call with an identifier argument: #BeforeBuild.UnparsedText: CYCLE832(0.05,_ORI_FINISH,0.8) #AfterBuild:

{
  "Parsing": { "CYCLE832": { "Args": ["0.05", "_ORI_FINISH", "0.8"] } }
}

Cancel form with empty parentheses: #BeforeBuild.UnparsedText: CYCLE832() #AfterBuild:

{
  "Parsing": { "CYCLE832": { "Args": [] } }
}

Leading-dot tolerance and numeric mode (older post shape), mixed line: #BeforeBuild.UnparsedText: N21 CYCLE832(.03,1,1) #AfterBuild:

{
  "UnparsedText": "N21",
  "Parsing": { "CYCLE832": { "Args": [".03", "1", "1"] } }
}

CYCLE800 with a quoted swivel-data-record name — the quoted run is one argument (quotes preserved for the consumer) and the remaining positional args split normally: #BeforeBuild.UnparsedText: CYCLE800(1,“R_DATA”,0,57,0,0,0,20.0116,4.5217,0,0,0,0,-1,0) #AfterBuild:

{
  "Parsing": {
    "CYCLE800": {
      "Args": [
        "1", "\"R_DATA\"", "0", "57", "0", "0", "0",
        "20.0116", "4.5217", "0", "0", "0", "0", "-1", "0"
      ]
    }
  }
}

A comma inside the quoted name does not split — the quoted run stays one argument (the reason the split is quote-aware at all): #BeforeBuild.UnparsedText: CYCLE800(1,“A,B”,0,57) #AfterBuild:

{
  "Parsing": {
    "CYCLE800": { "Args": ["1", "\"A,B\"", "0", "57"] }
  }
}

Constructors

SiemensCycleCallSyntax()

Initializes a new instance with default settings.

public SiemensCycleCallSyntax()

SiemensCycleCallSyntax(XElement)

Initializes a new instance by deserializing from the given XML element.

public SiemensCycleCallSyntax(XElement src)

Parameters

src XElement

Source XML element.

Fields

ArgsKey

Sub-object key holding the verbatim positional argument strings.

public const string ArgsKey = "Args"

Field Value

string

BareKey

Marker key for the bare (parenthesis-less) call form — keeps the sub-object non-empty so CleanupParsing sweeps by earlier Logic syntaxes cannot drop the signal.

public const string BareKey = "Bare"

Field Value

string

Properties

CycleNames

Cycle names this syntax captures. Whitelist only — every unlisted call stays whole in UnparsedText (see class remarks).

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

Property Value

List<string>

Name

Syntax kind name (typically the concrete type name).

public string Name { get; }

Property Value

string

XName

XML element name used to register this syntax with XFactory.

public static string XName { get; }

Property Value

string

Methods

Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>, NcDiagnosticProgress)

Build syntax arrangement into the syntaxPieceNode in-place.

public void Build(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)

Parameters

syntaxPieceNode LazyLinkedListNode<SyntaxPiece>
ncDependencyList List<INcDependency>
ncDiagnosticProgress NcDiagnosticProgress

MakeXmlSource(string, string, bool)

Creates an XML representation of the object. This method may also generate additional resources such as related files.

public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if true, the extended file creation is suppressed.

Returns

XElement

An XML element representing the object's state

Remarks

For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied. The baseDirectory is typically the folder at the nearest configuration file folder. Since the folder can be moving with the configuration file.

Reg(XFactory)

Registers this type's deserializer with the given XFactory (or Default when factory is null). Idempotent.

public static void Reg(XFactory factory = null)

Parameters

factory XFactory