Enhanced C#
Language of your choice: library documentation
Public static fields | Properties | Public Member Functions | List of all members
Loyc.Syntax.LNodeFactory Class Reference

Contains helper methods for creating LNodes. An LNodeFactory holds a reference to the current source file (File) so that it does not need to be repeated every time you create a node. More...


Source file:

Remarks

Contains helper methods for creating LNodes. An LNodeFactory holds a reference to the current source file (File) so that it does not need to be repeated every time you create a node.

Public static fields

static readonly LNode Missing_ = new StdIdNode(S.Missing, new SourceRange(null))
 

Properties

LNode Missing [get]
 
ISourceFile File [get, set]
 
LNode true [get]
 
LNode false [get]
 
LNode null [get]
 
LNode void [get]
 
LNode int_0 [get]
 
LNode int_1 [get]
 
LNode string_empty [get]
 

Public Member Functions

 LNodeFactory (ISourceFile file)
 
LNode this[0, Missing_]. IsIdNamed (S.TriviaNewline)) return node
 
LNode Id (string name, int startIndex=-1, int endIndex=-1)
 
LNode Id (Symbol name, int startIndex=-1, int endIndex=-1)
 
LNode Id (Token t)
 
LNode Literal (object value, int startIndex=-1, int endIndex=-1)
 
LNode Literal (Token t)
 
LNode Trivia (string suffix, object value)
 Creates a trivia node named "#trivia_" + suffix with the specified Value attached. More...
 
LNode Trivia (Symbol name, object value, int startIndex=-1, int endIndex=-1)
 Creates a trivia node with the specified Value attached. More...
 
LNode Call (LNode target, IEnumerable< LNode > args, int startIndex=-1, int endIndex=-1)
 
LNode Call (LNode target, VList< LNode > args, int startIndex=-1, int endIndex=-1)
 
LNode Call (LNode target, int startIndex=-1, int endIndex=-1)
 
LNode Call (LNode target, LNode _1, int startIndex=-1, int endIndex=-1)
 
LNode Call (LNode target, LNode _1, LNode _2, int startIndex=-1, int endIndex=-1)
 
LNode Call (LNode target, LNode _1, LNode _2, LNode _3, int startIndex=-1, int endIndex=-1)
 
LNode Call (LNode target, LNode _1, LNode _2, LNode _3, LNode _4, int startIndex=-1, int endIndex=-1)
 
LNode Call (LNode target, params LNode[] list)
 
LNode Call (LNode target, LNode[] list, int startIndex=-1, int endIndex=-1)
 
LNode Call (Symbol target, IEnumerable< LNode > args, int startIndex=-1, int endIndex=-1)
 
LNode Call (Symbol target, VList< LNode > args, int startIndex=-1, int endIndex=-1)
 
LNode Call (Symbol target, VList< LNode > args, int startIndex, int endIndex, int targetStart, int targetEnd, NodeStyle style=NodeStyle.Default)
 
LNode Call (Symbol target, int startIndex=-1, int endIndex=-1)
 
LNode Call (Symbol target, LNode _1, int startIndex=-1, int endIndex=-1)
 
LNode Call (Symbol target, LNode _1, LNode _2, int startIndex=-1, int endIndex=-1)
 
LNode Call (Symbol target, LNode _1, LNode _2, LNode _3, int startIndex=-1, int endIndex=-1)
 
LNode Call (Symbol target, LNode _1, LNode _2, LNode _3, LNode _4, int startIndex=-1, int endIndex=-1)
 
LNode Call (Symbol target, int startIndex, int endIndex, int targetStart, int targetEnd, NodeStyle style=NodeStyle.Default)
 
LNode Call (Symbol target, LNode _1, int startIndex, int endIndex, int targetStart, int targetEnd, NodeStyle style=NodeStyle.Default)
 
LNode Call (Symbol target, LNode _1, LNode _2, int startIndex, int endIndex, int targetStart, int targetEnd, NodeStyle style=NodeStyle.Default)
 
LNode Call (Symbol target, params LNode[] args)
 
LNode Call (Symbol target, LNode[] args, int startIndex=-1, int endIndex=-1)
 
LNode Call (string target, IEnumerable< LNode > args, int startIndex=-1, int endIndex=-1)
 
LNode Call (string target, VList< LNode > args, int startIndex=-1, int endIndex=-1)
 
LNode Call (string target, int startIndex=-1, int endIndex=-1)
 
LNode Call (string target, LNode _1, int startIndex=-1, int endIndex=-1)
 
LNode Call (string target, LNode _1, LNode _2, int startIndex=-1, int endIndex=-1)
 
LNode Call (string target, LNode _1, LNode _2, LNode _3, int startIndex=-1, int endIndex=-1)
 
LNode Call (string target, LNode _1, LNode _2, LNode _3, LNode _4, int startIndex=-1, int endIndex=-1)
 
LNode Call (string target, params LNode[] args)
 
LNode Call (string target, LNode[] args, int startIndex=-1, int endIndex=-1)
 
LNode Call (Token target, IEnumerable< LNode > args, int startIndex=-1, int endIndex=-1, NodeStyle style=NodeStyle.Default)
 
LNode Call (Token target, VList< LNode > args, int startIndex=-1, int endIndex=-1, NodeStyle style=NodeStyle.Default)
 
LNode Call (Token target, int startIndex=-1, int endIndex=-1, NodeStyle style=NodeStyle.Default)
 
LNode Call (Token target, LNode _1, int startIndex=-1, int endIndex=-1, NodeStyle style=NodeStyle.Default)
 
LNode Call (Token target, LNode _1, LNode _2, int startIndex=-1, int endIndex=-1, NodeStyle style=NodeStyle.Default)
 
LNode Dot (Symbol prefix, Symbol symbol)
 
LNode Dot (params string[] symbols)
 
LNode Dot (params Symbol[] symbols)
 
LNode Dot (params LNode[] parts)
 
LNode Dot (LNode prefix, Symbol symbol, int startIndex=-1, int endIndex=-1)
 
LNode Dot (LNode prefix, LNode symbol, int startIndex=-1, int endIndex=-1)
 
LNode Dot (LNode prefix, LNode symbol, int startIndex, int endIndex, int dotStart, int dotEnd, NodeStyle style=NodeStyle.Default)
 
LNode Of (params Symbol[] list)
 
LNode Of (params LNode[] list)
 
LNode Of (LNode stem, LNode T1, int startIndex=-1, int endIndex=-1)
 
LNode Of (Symbol stem, LNode T1, int startIndex=-1, int endIndex=-1)
 
LNode Of (LNode stem, IEnumerable< LNode > typeParams, int startIndex=-1, int endIndex=-1)
 
LNode Of (Symbol stem, IEnumerable< LNode > typeParams, int startIndex=-1, int endIndex=-1)
 
LNode Braces (params LNode[] contents)
 
LNode Braces (VList< LNode > contents, int startIndex=-1, int endIndex=-1)
 
LNode Braces (LNode[] contents, int startIndex=-1, int endIndex=-1)
 
LNode Braces (IEnumerable< LNode > contents, int startIndex=-1, int endIndex=-1)
 
LNode List ()
 
LNode List (params LNode[] contents)
 
LNode List (LNode[] contents, int startIndex=-1, int endIndex=-1)
 
LNode List (VList< LNode > contents, int startIndex=-1, int endIndex=-1)
 
LNode List (IEnumerable< LNode > contents, int startIndex=-1, int endIndex=-1)
 
LNode Splice ()
 
LNode Splice (params LNode[] contents)
 
LNode Splice (LNode[] contents, int startIndex=-1, int endIndex=-1)
 
LNode Splice (VList< LNode > contents, int startIndex=-1, int endIndex=-1)
 
LNode Splice (IEnumerable< LNode > contents, int startIndex=-1, int endIndex=-1)
 
LNode Tuple ()
 
LNode Tuple (params LNode[] contents)
 
LNode Tuple (LNode[] contents, int startIndex=-1, int endIndex=-1)
 
LNode Tuple (VList< LNode > contents, int startIndex=-1, int endIndex=-1)
 
LNode Tuple (IEnumerable< LNode > contents, int startIndex=-1, int endIndex=-1)
 
LNode Fn (LNode retType, Symbol name, LNode argList, LNode body=null, int startIndex=-1, int endIndex=-1)
 
LNode Fn (LNode retType, LNode name, LNode argList, LNode body=null, int startIndex=-1, int endIndex=-1)
 
LNode Property (LNode type, LNode name, LNode body=null, int startIndex=-1, int endIndex=-1)
 
LNode Property (LNode type, LNode name, LNode argList, LNode body, LNode initializer=null, int startIndex=-1, int endIndex=-1)
 
LNode Var (LNode type, string name, LNode initValue=null, int startIndex=-1, int endIndex=-1)
 
LNode Var (LNode type, Symbol name, LNode initValue=null, int startIndex=-1, int endIndex=-1)
 
LNode Var (LNode type, LNode name, LNode initValue=null, int startIndex=-1, int endIndex=-1)
 
LNode Var (LNode type, LNode name)
 
LNode Vars (LNode type, params Symbol[] names)
 
LNode Vars (LNode type, params LNode[] namesWithValues)
 
LNode InParens (LNode inner)
 
LNode InParens (LNode inner, int startIndex, int endIndex)
 
LNode Result (LNode expr)
 
LNode Attr (LNode attr, LNode node)
 
LNode Attr (params LNode[] attrsAndNode)
 
LNode Assign (Symbol lhs, LNode rhs, int startIndex=-1, int endIndex=-1)
 
LNode Assign (LNode lhs, LNode rhs, int startIndex=-1, int endIndex=-1)
 

Member Function Documentation

LNode Loyc.Syntax.LNodeFactory.Trivia ( string  suffix,
object  value 
)
inline

Creates a trivia node named "#trivia_" + suffix with the specified Value attached.

This method only adds the prefix #trivia_ if it is not already present in the 'suffix' argument.

Referenced by Loyc.LLParserGenerator.LLParserGenerator.GenerateCodeVisitor.Visit().

LNode Loyc.Syntax.LNodeFactory.Trivia ( Symbol  name,
object  value,
int  startIndex = -1,
int  endIndex = -1 
)
inline

Creates a trivia node with the specified Value attached.

See also
LNode.Trivia(Symbol, object, LNode)

References Loyc.Collections.Add, Loyc.Syntax.LNode.Attrs, Loyc.Syntax.LNode.Calls(), Loyc.Syntax.LNodeExt.InParens(), Loyc.Syntax.LNode.Name, and Loyc.Syntax.LNode.Range.