C# Class Loyc.Syntax.LNodeFactory

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.
Show file Open project: qwertie/ecsharp Class Usage Examples

Public Properties

Property Type Description
Missing_ LNode

Public Methods

Method Description
Assign ( LNode lhs, LNode rhs, int startIndex = -1, int endIndex = -1 ) : LNode
Assign ( Symbol lhs, LNode rhs, int startIndex = -1, int endIndex = -1 ) : LNode
Attr ( ) : LNode
Attr ( LNode attr, LNode node ) : LNode
Braces ( ) : LNode
Braces ( IEnumerable contents, int startIndex = -1, int endIndex = -1 ) : LNode
Braces ( LNode contents, int startIndex = -1, int endIndex = -1 ) : LNode
Braces ( VList contents, int startIndex = -1, int endIndex = -1 ) : LNode
Call ( LNode target ) : LNode
Call ( LNode target, IEnumerable args, 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, LNode _1, LNode _2, LNode _3, 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, int startIndex = -1, int endIndex = -1 ) : LNode
Call ( LNode target, VList args, int startIndex = -1, int endIndex = -1 ) : LNode
Call ( LNode target, int startIndex = -1, int endIndex = -1 ) : LNode
Call ( Symbol target ) : LNode
Call ( Symbol target, IEnumerable args, 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, LNode _1, LNode _2, LNode _3, 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, int startIndex, int endIndex, int targetStart, int targetEnd, NodeStyle style = NodeStyle.Default ) : LNode
Call ( Symbol target, LNode _1, int startIndex = -1, int endIndex = -1 ) : LNode
Call ( Symbol target, LNode _1, int startIndex, int endIndex, int targetStart, int targetEnd, NodeStyle style = NodeStyle.Default ) : LNode
Call ( Symbol target, VList args, int startIndex = -1, int endIndex = -1 ) : LNode
Call ( Symbol target, VList 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, int startIndex, int endIndex, int targetStart, int targetEnd, NodeStyle style = NodeStyle.Default ) : LNode
Call ( Token target, IEnumerable args, 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
Call ( Token target, LNode _1, int startIndex = -1, int endIndex = -1, NodeStyle style = NodeStyle.Default ) : LNode
Call ( Token target, VList 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 ( string target ) : LNode
Call ( string target, IEnumerable args, 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, LNode _1, LNode _2, LNode _3, 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, int startIndex = -1, int endIndex = -1 ) : LNode
Call ( string target, VList args, int startIndex = -1, int endIndex = -1 ) : LNode
Call ( string target, int startIndex = -1, int endIndex = -1 ) : LNode
Dot ( ) : 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
Dot ( LNode prefix, Symbol symbol, int startIndex = -1, int endIndex = -1 ) : LNode
Dot ( Symbol prefix, Symbol symbol ) : LNode
Fn ( LNode retType, LNode name, LNode argList, LNode body = null, int startIndex = -1, int endIndex = -1 ) : LNode
Fn ( LNode retType, Symbol name, LNode argList, LNode body = null, int startIndex = -1, int endIndex = -1 ) : LNode
Id ( Symbol name, int startIndex = -1, int endIndex = -1 ) : LNode
Id ( Token t ) : LNode
Id ( string name, int startIndex = -1, int endIndex = -1 ) : LNode
InParens ( LNode inner ) : LNode
InParens ( LNode inner, int startIndex, int endIndex ) : LNode
LNodeFactory ( ISourceFile file ) : System
List ( ) : LNode
List ( IEnumerable contents, int startIndex = -1, int endIndex = -1 ) : LNode
List ( LNode contents, int startIndex = -1, int endIndex = -1 ) : LNode
List ( VList contents, int startIndex = -1, int endIndex = -1 ) : LNode
Literal ( Token t ) : LNode
Literal ( object value, int startIndex = -1, int endIndex = -1 ) : LNode
Of ( ) : LNode
Of ( LNode stem, IEnumerable typeParams, int startIndex = -1, int endIndex = -1 ) : LNode
Of ( LNode stem, LNode T1, int startIndex = -1, int endIndex = -1 ) : LNode
Of ( Symbol stem, IEnumerable typeParams, int startIndex = -1, int endIndex = -1 ) : LNode
Of ( Symbol stem, LNode T1, int startIndex = -1, int endIndex = -1 ) : LNode
OnNewLine ( LNode node ) : LNode

Adds a leading newline to the node if the first attribute isn't a newline.

By convention, in Loyc languages, top-level nodes and nodes within braces have an implicit newline, such that a leading blank line appears if you add CodeSymbols.TriviaNewline. For all other nodes, this method just ensures there is a line break.

Property ( LNode type, LNode name, LNode argList, LNode body, LNode initializer = null, int startIndex = -1, int endIndex = -1 ) : LNode
Property ( LNode type, LNode name, LNode body = null, int startIndex = -1, int endIndex = -1 ) : LNode
Result ( LNode expr ) : LNode
Splice ( ) : LNode
Splice ( IEnumerable contents, int startIndex = -1, int endIndex = -1 ) : LNode
Splice ( LNode contents, int startIndex = -1, int endIndex = -1 ) : LNode
Splice ( VList contents, int startIndex = -1, int endIndex = -1 ) : LNode
Trivia ( Symbol name, object value, int startIndex = -1, int endIndex = -1 ) : LNode

Creates a trivia node with the specified Value attached.

Trivia ( string suffix, object value ) : LNode

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.

Tuple ( ) : LNode
Tuple ( IEnumerable contents, int startIndex = -1, int endIndex = -1 ) : LNode
Tuple ( LNode contents, int startIndex = -1, int endIndex = -1 ) : LNode
Tuple ( VList contents, int startIndex = -1, int endIndex = -1 ) : LNode
Var ( LNode type, LNode name ) : LNode
Var ( LNode type, LNode 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, string name, LNode initValue = null, int startIndex = -1, int endIndex = -1 ) : LNode
Vars ( LNode type ) : LNode

Method Details

Assign() public method

public Assign ( LNode lhs, LNode rhs, int startIndex = -1, int endIndex = -1 ) : LNode
lhs LNode
rhs LNode
startIndex int
endIndex int
return LNode

Assign() public method

public Assign ( Symbol lhs, LNode rhs, int startIndex = -1, int endIndex = -1 ) : LNode
lhs Symbol
rhs LNode
startIndex int
endIndex int
return LNode

Attr() public method

public Attr ( ) : LNode
return LNode

Attr() public method

public Attr ( LNode attr, LNode node ) : LNode
attr LNode
node LNode
return LNode

Braces() public method

public Braces ( ) : LNode
return LNode

Braces() public method

public Braces ( IEnumerable contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents IEnumerable
startIndex int
endIndex int
return LNode

Braces() public method

public Braces ( LNode contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents LNode
startIndex int
endIndex int
return LNode

Braces() public method

public Braces ( VList contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents VList
startIndex int
endIndex int
return LNode

Call() public method

public Call ( LNode target ) : LNode
target LNode
return LNode

Call() public method

public Call ( LNode target, IEnumerable args, int startIndex = -1, int endIndex = -1 ) : LNode
target LNode
args IEnumerable
startIndex int
endIndex int
return LNode

Call() public method

public Call ( LNode target, LNode _1, LNode _2, LNode _3, LNode _4, int startIndex = -1, int endIndex = -1 ) : LNode
target LNode
_1 LNode
_2 LNode
_3 LNode
_4 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( LNode target, LNode _1, LNode _2, LNode _3, int startIndex = -1, int endIndex = -1 ) : LNode
target LNode
_1 LNode
_2 LNode
_3 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( LNode target, LNode _1, LNode _2, int startIndex = -1, int endIndex = -1 ) : LNode
target LNode
_1 LNode
_2 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( LNode target, LNode _1, int startIndex = -1, int endIndex = -1 ) : LNode
target LNode
_1 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( LNode target, VList args, int startIndex = -1, int endIndex = -1 ) : LNode
target LNode
args VList
startIndex int
endIndex int
return LNode

Call() public method

public Call ( LNode target, int startIndex = -1, int endIndex = -1 ) : LNode
target LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( Symbol target ) : LNode
target Symbol
return LNode

Call() public method

public Call ( Symbol target, IEnumerable args, int startIndex = -1, int endIndex = -1 ) : LNode
target Symbol
args IEnumerable
startIndex int
endIndex int
return LNode

Call() public method

public Call ( Symbol target, LNode _1, LNode _2, LNode _3, LNode _4, int startIndex = -1, int endIndex = -1 ) : LNode
target Symbol
_1 LNode
_2 LNode
_3 LNode
_4 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( Symbol target, LNode _1, LNode _2, LNode _3, int startIndex = -1, int endIndex = -1 ) : LNode
target Symbol
_1 LNode
_2 LNode
_3 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( Symbol target, LNode _1, LNode _2, int startIndex = -1, int endIndex = -1 ) : LNode
target Symbol
_1 LNode
_2 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( Symbol target, LNode _1, LNode _2, int startIndex, int endIndex, int targetStart, int targetEnd, NodeStyle style = NodeStyle.Default ) : LNode
target Symbol
_1 LNode
_2 LNode
startIndex int
endIndex int
targetStart int
targetEnd int
style NodeStyle
return LNode

Call() public method

public Call ( Symbol target, LNode _1, int startIndex = -1, int endIndex = -1 ) : LNode
target Symbol
_1 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( Symbol target, LNode _1, int startIndex, int endIndex, int targetStart, int targetEnd, NodeStyle style = NodeStyle.Default ) : LNode
target Symbol
_1 LNode
startIndex int
endIndex int
targetStart int
targetEnd int
style NodeStyle
return LNode

Call() public method

public Call ( Symbol target, VList args, int startIndex = -1, int endIndex = -1 ) : LNode
target Symbol
args VList
startIndex int
endIndex int
return LNode

Call() public method

public Call ( Symbol target, VList args, int startIndex, int endIndex, int targetStart, int targetEnd, NodeStyle style = NodeStyle.Default ) : LNode
target Symbol
args VList
startIndex int
endIndex int
targetStart int
targetEnd int
style NodeStyle
return LNode

Call() public method

public Call ( Symbol target, int startIndex = -1, int endIndex = -1 ) : LNode
target Symbol
startIndex int
endIndex int
return LNode

Call() public method

public Call ( Symbol target, int startIndex, int endIndex, int targetStart, int targetEnd, NodeStyle style = NodeStyle.Default ) : LNode
target Symbol
startIndex int
endIndex int
targetStart int
targetEnd int
style NodeStyle
return LNode

Call() public method

public Call ( Token target, IEnumerable args, int startIndex = -1, int endIndex = -1, NodeStyle style = NodeStyle.Default ) : LNode
target Token
args IEnumerable
startIndex int
endIndex int
style NodeStyle
return LNode

Call() public method

public Call ( Token target, LNode _1, LNode _2, int startIndex = -1, int endIndex = -1, NodeStyle style = NodeStyle.Default ) : LNode
target Token
_1 LNode
_2 LNode
startIndex int
endIndex int
style NodeStyle
return LNode

Call() public method

public Call ( Token target, LNode _1, int startIndex = -1, int endIndex = -1, NodeStyle style = NodeStyle.Default ) : LNode
target Token
_1 LNode
startIndex int
endIndex int
style NodeStyle
return LNode

Call() public method

public Call ( Token target, VList args, int startIndex = -1, int endIndex = -1, NodeStyle style = NodeStyle.Default ) : LNode
target Token
args VList
startIndex int
endIndex int
style NodeStyle
return LNode

Call() public method

public Call ( Token target, int startIndex = -1, int endIndex = -1, NodeStyle style = NodeStyle.Default ) : LNode
target Token
startIndex int
endIndex int
style NodeStyle
return LNode

Call() public method

public Call ( string target ) : LNode
target string
return LNode

Call() public method

public Call ( string target, IEnumerable args, int startIndex = -1, int endIndex = -1 ) : LNode
target string
args IEnumerable
startIndex int
endIndex int
return LNode

Call() public method

public Call ( string target, LNode _1, LNode _2, LNode _3, LNode _4, int startIndex = -1, int endIndex = -1 ) : LNode
target string
_1 LNode
_2 LNode
_3 LNode
_4 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( string target, LNode _1, LNode _2, LNode _3, int startIndex = -1, int endIndex = -1 ) : LNode
target string
_1 LNode
_2 LNode
_3 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( string target, LNode _1, LNode _2, int startIndex = -1, int endIndex = -1 ) : LNode
target string
_1 LNode
_2 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( string target, LNode _1, int startIndex = -1, int endIndex = -1 ) : LNode
target string
_1 LNode
startIndex int
endIndex int
return LNode

Call() public method

public Call ( string target, VList args, int startIndex = -1, int endIndex = -1 ) : LNode
target string
args VList
startIndex int
endIndex int
return LNode

Call() public method

public Call ( string target, int startIndex = -1, int endIndex = -1 ) : LNode
target string
startIndex int
endIndex int
return LNode

Dot() public method

public Dot ( ) : LNode
return LNode

Dot() public method

public Dot ( LNode prefix, LNode symbol, int startIndex = -1, int endIndex = -1 ) : LNode
prefix LNode
symbol LNode
startIndex int
endIndex int
return LNode

Dot() public method

public Dot ( LNode prefix, LNode symbol, int startIndex, int endIndex, int dotStart, int dotEnd, NodeStyle style = NodeStyle.Default ) : LNode
prefix LNode
symbol LNode
startIndex int
endIndex int
dotStart int
dotEnd int
style NodeStyle
return LNode

Dot() public method

public Dot ( LNode prefix, Symbol symbol, int startIndex = -1, int endIndex = -1 ) : LNode
prefix LNode
symbol Symbol
startIndex int
endIndex int
return LNode

Dot() public method

public Dot ( Symbol prefix, Symbol symbol ) : LNode
prefix Symbol
symbol Symbol
return LNode

Fn() public method

public Fn ( LNode retType, LNode name, LNode argList, LNode body = null, int startIndex = -1, int endIndex = -1 ) : LNode
retType LNode
name LNode
argList LNode
body LNode
startIndex int
endIndex int
return LNode

Fn() public method

public Fn ( LNode retType, Symbol name, LNode argList, LNode body = null, int startIndex = -1, int endIndex = -1 ) : LNode
retType LNode
name Symbol
argList LNode
body LNode
startIndex int
endIndex int
return LNode

Id() public method

public Id ( Symbol name, int startIndex = -1, int endIndex = -1 ) : LNode
name Symbol
startIndex int
endIndex int
return LNode

Id() public method

public Id ( Token t ) : LNode
t Token
return LNode

Id() public method

public Id ( string name, int startIndex = -1, int endIndex = -1 ) : LNode
name string
startIndex int
endIndex int
return LNode

InParens() public method

public InParens ( LNode inner ) : LNode
inner LNode
return LNode

InParens() public method

public InParens ( LNode inner, int startIndex, int endIndex ) : LNode
inner LNode
startIndex int
endIndex int
return LNode

LNodeFactory() public method

public LNodeFactory ( ISourceFile file ) : System
file ISourceFile
return System

List() public method

public List ( ) : LNode
return LNode

List() public method

public List ( IEnumerable contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents IEnumerable
startIndex int
endIndex int
return LNode

List() public method

public List ( LNode contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents LNode
startIndex int
endIndex int
return LNode

List() public method

public List ( VList contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents VList
startIndex int
endIndex int
return LNode

Literal() public method

public Literal ( Token t ) : LNode
t Token
return LNode

Literal() public method

public Literal ( object value, int startIndex = -1, int endIndex = -1 ) : LNode
value object
startIndex int
endIndex int
return LNode

Of() public method

public Of ( ) : LNode
return LNode

Of() public method

public Of ( LNode stem, IEnumerable typeParams, int startIndex = -1, int endIndex = -1 ) : LNode
stem LNode
typeParams IEnumerable
startIndex int
endIndex int
return LNode

Of() public method

public Of ( LNode stem, LNode T1, int startIndex = -1, int endIndex = -1 ) : LNode
stem LNode
T1 LNode
startIndex int
endIndex int
return LNode

Of() public method

public Of ( Symbol stem, IEnumerable typeParams, int startIndex = -1, int endIndex = -1 ) : LNode
stem Symbol
typeParams IEnumerable
startIndex int
endIndex int
return LNode

Of() public method

public Of ( Symbol stem, LNode T1, int startIndex = -1, int endIndex = -1 ) : LNode
stem Symbol
T1 LNode
startIndex int
endIndex int
return LNode

OnNewLine() public method

Adds a leading newline to the node if the first attribute isn't a newline.
By convention, in Loyc languages, top-level nodes and nodes within braces have an implicit newline, such that a leading blank line appears if you add CodeSymbols.TriviaNewline. For all other nodes, this method just ensures there is a line break.
public OnNewLine ( LNode node ) : LNode
node LNode
return LNode

Property() public method

public Property ( LNode type, LNode name, LNode argList, LNode body, LNode initializer = null, int startIndex = -1, int endIndex = -1 ) : LNode
type LNode
name LNode
argList LNode
body LNode
initializer LNode
startIndex int
endIndex int
return LNode

Property() public method

public Property ( LNode type, LNode name, LNode body = null, int startIndex = -1, int endIndex = -1 ) : LNode
type LNode
name LNode
body LNode
startIndex int
endIndex int
return LNode

Result() public method

public Result ( LNode expr ) : LNode
expr LNode
return LNode

Splice() public method

public Splice ( ) : LNode
return LNode

Splice() public method

public Splice ( IEnumerable contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents IEnumerable
startIndex int
endIndex int
return LNode

Splice() public method

public Splice ( LNode contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents LNode
startIndex int
endIndex int
return LNode

Splice() public method

public Splice ( VList contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents VList
startIndex int
endIndex int
return LNode

Trivia() public method

Creates a trivia node with the specified Value attached.
public Trivia ( Symbol name, object value, int startIndex = -1, int endIndex = -1 ) : LNode
name Symbol
value object
startIndex int
endIndex int
return LNode

Trivia() public method

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.
public Trivia ( string suffix, object value ) : LNode
suffix string
value object
return LNode

Tuple() public method

public Tuple ( ) : LNode
return LNode

Tuple() public method

public Tuple ( IEnumerable contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents IEnumerable
startIndex int
endIndex int
return LNode

Tuple() public method

public Tuple ( LNode contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents LNode
startIndex int
endIndex int
return LNode

Tuple() public method

public Tuple ( VList contents, int startIndex = -1, int endIndex = -1 ) : LNode
contents VList
startIndex int
endIndex int
return LNode

Var() public method

public Var ( LNode type, LNode name ) : LNode
type LNode
name LNode
return LNode

Var() public method

public Var ( LNode type, LNode name, LNode initValue = null, int startIndex = -1, int endIndex = -1 ) : LNode
type LNode
name LNode
initValue LNode
startIndex int
endIndex int
return LNode

Var() public method

public Var ( LNode type, Symbol name, LNode initValue = null, int startIndex = -1, int endIndex = -1 ) : LNode
type LNode
name Symbol
initValue LNode
startIndex int
endIndex int
return LNode

Var() public method

public Var ( LNode type, string name, LNode initValue = null, int startIndex = -1, int endIndex = -1 ) : LNode
type LNode
name string
initValue LNode
startIndex int
endIndex int
return LNode

Vars() public method

public Vars ( LNode type ) : LNode
type LNode
return LNode

Property Details

Missing_ public static property

public static LNode Missing_
return LNode