Class HeadCommentSyntax
- Namespace
- Hi.NcParsers.ParsingSyntaxs.CommentSyntaxs
- Assembly
- HiMech.dll
In-situ syntax for a comment that owns its whole block: a line whose first
word, after the optional block number, is HeadSymbol is a
comment from that symbol to the end of the line, and nothing on it is
vocabulary. The klartext structuring block is the case — the
* - OPERATION: ROUGH - TOOL: T0 item a post-processor writes for
the control's structure window — where the T0 is text, not a tool
word for the root tag capture to eat. The block number ahead of the symbol
stays in place for HeadIndexSyntax; the symbol anywhere else
on the line (Q1 = Q2 * 3) is not a comment start. Single-line
sentences only: the grouped sentences (a CYCL DEF family, a
~ chain) never open with one.
public class HeadCommentSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
HeadCommentSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
#BeforeBuild.UnparsedText: 7 * - OPERATION: 04.3.KANIKA_BOT - TOOL: T0 BLADE_V2 (with HeadSymbol="*"; the block number stays for HeadIndexSyntax)
#AfterBuild:
{
"UnparsedText": "7",
"Comment": { "Symbol": "*", "Text": "- OPERATION: 04.3.KANIKA_BOT - TOOL: T0 BLADE_V2" }
}
#BeforeBuild.UnparsedText: * Roughing (D18) (no block number; the parentheses are part of the text, never a comment of their own)
#AfterBuild:
{
"Comment": { "Symbol": "*", "Text": "Roughing (D18)" }
}
#BeforeBuild.UnparsedText: Q1 = Q2 * 3 (the symbol inside an expression is not a comment start)
#AfterBuild:
{
"UnparsedText": "Q1 = Q2 * 3"
}
Constructors
HeadCommentSyntax(string)
Creates syntax with the given head symbol; used from code or tests without XML.
public HeadCommentSyntax(string headSymbol)
Parameters
headSymbolstringSymbol that opens the whole-line comment.
HeadCommentSyntax(XElement)
Loads HeadSymbol from persisted XML.
public HeadCommentSyntax(XElement src)
Parameters
srcXElementSerialized syntax element.
Properties
HeadSymbol
The symbol that opens the comment when it is the line's first word
after the optional block number (* for the klartext
structuring block).
public string HeadSymbol { get; set; }
Property Value
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
XName
XML element name for Generators registration.
public static string XName { get; }
Property Value
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
syntaxPieceNodeLazyLinkedListNode<SyntaxPiece>ncDependencyListList<INcDependency>ncDiagnosticProgressNcDiagnosticProgress
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
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
exhibitionOnlyboolif 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
factoryXFactory