Table of Contents

Class SiemensGotoParsingSyntax

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

Captures Siemens GOTOF/GOTOB jump statements whole into Parsing.SiemensGoto. Four forms are recognised, mirroring the Fanuc phrase-level split (IF ... GOTO is one phrase, not an IF composed with a GOTO):

  • GOTOF <label> / GOTOB <label> — unconditional forward / backward jump.
  • IF <cond> GOTOF <label> / IF <cond> GOTOB <label> — the Sinumerik single-line conditional jump (no brackets around the condition).

Placement: inside the whole-statement owner group, after SiemensRepeatParsingSyntax and before SiemensIfParsingSyntax — the IF-jump forms carry a strictly longer prefix than the block IF <cond> phrase, so this owner must win first (the block-IF owner also refuses GOTOF/GOTOB tails defensively). Must run before the assignment syntaxes: IF R1==1 GOTOF LBL1 would otherwise be shredded by the assignment capture (its LHS grammar matches R1 and the first = of ==).

The label is captured as written (LBL1, MARKE_A, or an N<num> block number — both are legal Sinumerik jump targets). The condition string is left for VariableEvaluatorSyntax's pass-2 tree walk; SiemensGotoSyntax consumes the section.

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

Examples

Bare forward jump: #BeforeBuild.UnparsedText: GOTOF LBL1 #AfterBuild:

{
  "Parsing": { "SiemensGoto": { "Term": "GOTOF", "Label": "LBL1" } }
}

Bare backward jump to an underscore label: #BeforeBuild.UnparsedText: GOTOB MARKE_A #AfterBuild:

{
  "Parsing": { "SiemensGoto": { "Term": "GOTOB", "Label": "MARKE_A" } }
}

Single-line conditional forward jump — the condition keeps its Sinumerik spelling for the evaluator: #BeforeBuild.UnparsedText: IF R1==1 GOTOF LBL2 #AfterBuild:

{
  "Parsing": {
    "SiemensGoto": {
      "Term": "IF...GOTOF",
      "Label": "LBL2",
      "Condition": "R1==1"
    }
  }
}

Conditional backward jump with a comparison condition: #BeforeBuild.UnparsedText: IF R10<5 GOTOB START_MK #AfterBuild:

{
  "Parsing": {
    "SiemensGoto": {
      "Term": "IF...GOTOB",
      "Label": "START_MK",
      "Condition": "R10<5"
    }
  }
}

Constructors

SiemensGotoParsingSyntax()

Parameterless instance (no XML state).

public SiemensGotoParsingSyntax()

SiemensGotoParsingSyntax(XElement)

XML ctor (no child elements; reserved for forward compatibility).

public SiemensGotoParsingSyntax(XElement src)

Parameters

src XElement

Root element named XName.

Properties

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