메소드 |
설명 |
|
ArgCount ( this node ) : int |
|
|
ArgNamed ( this self, Symbol name ) : LNode |
|
|
Args ( this node ) : NegListSlice |
|
|
AsLNode ( this list, Symbol listIdentifier ) : LNode |
Converts a list of LNodes to a single LNode by using the list as the argument list in a call to the specified identifier, or, if the list contains a single item, by returning that single item. This is the reverse of the operation performed by AsList(LNode,Symbol). |
|
AsList ( this block, Symbol listIdentifier ) : VList |
Interprets a node as a list by returning block.Args if block.Calls(listIdentifier) , otherwise returning a one-item list of nodes with block as the only item. |
|
AttrCount ( this node ) : int |
|
|
AttrNamed ( this node, Symbol name ) : ILNode |
|
|
AttrNamed ( this self, Symbol name ) : LNode |
|
|
Attrs ( this node ) : NegListSlice |
|
|
BaseStyle ( this node ) : NodeStyle |
|
|
Calls ( this node, Symbol name ) : bool |
|
|
GetCaptureIdentifier ( LNode pattern, bool identifierRequired = true ) : LNode |
Checks if pattern matches one of the syntax trees $x or $(..x) or $(...x) for some identifier x . These are conventionally used to represent partial syntax trees. |
|
GetTrailingTrivia ( this node ) : IListSource |
|
|
GetTrailingTrivia ( this node ) : VList |
Gets all trailing trivia attached to the specified node. |
|
GetTrailingTrivia ( this attrs ) : VList |
Gets all trailing trivia attached to the specified node. Trailing trivia is represented by a call to #trivia_trailing in a node's attribute list; each argument to #trivia_trailing represents one piece of trivia. If the attribute list has multiple calls to #trivia_trailing, this method combines those lists into a single list. |
|
GetTrivia ( this node ) : VList |
|
|
GetTrivia ( this attrs ) : VList |
|
|
HasAttrs ( this node ) : bool |
|
|
HasPAttrs ( this node ) : bool |
|
|
HasSpecialName ( this node ) : bool |
|
|
InParens ( this node ) : LNode |
Returns the same node with a parentheses attribute added. |
|
InParens ( this node, ISourceFile file, int startIndex, int endIndex ) : LNode |
Returns the same node with a parentheses attribute added. |
|
InParens ( this node, SourceRange range ) : LNode |
Returns the same node with a parentheses attribute added. The node's range is changed to the provided SourceRange and the original range of the node is assigned to the parentheses attribute. |
|
IndexWithName ( this self, Symbol name, int resultIfNotFound = -1 ) : int |
|
|
IsCall ( this node ) : bool |
|
|
IsId ( this node ) : bool |
|
|
IsIdNamed ( this node, Symbol name ) : bool |
|
|
IsIdNamed ( this node, string name ) : bool |
|
|
IsLiteral ( this node ) : bool |
|
|
IsParenthesizedExpr ( this node ) : bool |
|
|
IsTrivia ( this node ) : bool |
|
|
MatchesPattern ( this candidate, LNode pattern, LNode>.IDictionary &captures ) : bool |
|
|
MatchesPattern ( this candidate, LNode pattern, LNode>.IDictionary &captures, VList &unmatchedAttrs ) : bool |
|
|
MatchesPattern ( this candidate, LNode pattern, LNode>.MMap &captures, VList &unmatchedAttrs ) : bool |
Determines whether one Loyc tree "matches" another. This is different from a simple equality test in that (1) trivia atributes do not have to match, and (2) the pattern can contain placeholders represented by calls to $ (the substitution operator) with an identifier as a parameter. Placeholders match any subtree, and are saved to the captures map. Attributes in patterns are not yet supported. This method supports multi-part captures, which are matched to placeholders whose identifier either (A) has a #params attribute or (B) has the unary ".." operator applied to it (for example, if the placeholder is called p, this is written as $(params p) in EC#.) A placeholder that looks like this can match multiple arguments or multiple statements in the candidate (or no arguments, or no statements), and will become a #splice(...) node in captures if it matches multiple items. Multi-part captures are often useful for getting lists of statements before and after some required element, e.g. { $(params before); MatchThis($something); $(params after); } If the same placeholder appears twice then the two matching items are combined into a single output node (calling #splice). If matching is unsuccessful, captures and unmatchedAttrs may contain irrelevant information gathered during the attempt to match. In EC#, the quote(...) macro can be used to create the LNode object for a pattern. |
|
NodeNamed ( this self, Symbol name ) : ILNode |
|
|
NodeNamed ( this self, Symbol name ) : LNode |
|
|
PlusTrailingTrivia ( this node, LNode trivia ) : LNode |
Adds additional trailing trivia to a node. |
|
PlusTrailingTrivia ( this node, VList trivia ) : LNode |
Adds additional trailing trivia to a node. |
|
PlusTrailingTrivia ( this attrs, LNode trivia ) : VList |
Adds additional trailing trivia to an attribute list. |
|
PlusTrailingTrivia ( this attrs, VList trivia ) : VList |
Adds additional trailing trivia to an attribute list. Has no effect if trivia is empty. Trailing trivia is represented by a call to #trivia_trailing in a node's attribute list; each argument to #trivia_trailing represents one piece of trivia. In the current design, this method has a side-effect of recreating the #trivia_trailing node at the end of the attribute list, and if there are multiple #trivia_trailing lists, consolidating them into a single list, but only if the specified trivia list is not empty. |
|
SpliceAdd ( this list, LNode node, Symbol listName = null ) : void |
|
|
SpliceInsert ( this list, int index, LNode node, Symbol listName = null ) : void |
|
|
ToLNode ( ILNode node ) : LNode |
Converts ILNode to LNode recursively. If the specified node is already an LNode, this method simply does a cast. |
|
WithSpliced ( this list, LNode node, Symbol listName = null ) : VList |
|
|
WithSpliced ( this list, int index, LNode node, Symbol listName = null ) : VList |
|
|
WithTrailingTrivia ( this node, VList trivia ) : LNode |
Removes a node's trailing trivia and adds a new list of trailing trivia. |
|
WithTrailingTrivia ( this attrs, VList trivia ) : VList |
Removes all existing trailing trivia from an attribute list and adds a new list of trailing trivia. This method has a side-effect of recreating the #trivia_trailing node, if there is one, at the end of the attribute list. If trivia is empty then all calls to #trivia_trailing are removed. |
|
Without ( this list, LNode node ) : VList |
|
|
WithoutAttr ( this self, LNode node ) : LNode |
|
|
WithoutAttrNamed ( this self, Symbol name ) : LNode |
|
|
WithoutAttrNamed ( this self, Symbol name, LNode &removedAttr ) : LNode |
|
|
WithoutNodeNamed ( this a, Symbol name ) : VList |
|
|
WithoutNodeNamed ( this list, Symbol name, LNode &removedNode ) : VList |
|
|
WithoutOuterParens ( this self ) : LNode |
Removes a single pair of parentheses, if the node has a #trivia_inParens attribute. Returns the same node when no parens are present. |
|
WithoutTrailingTrivia ( this attrs ) : VList |
Gets a new list with any #trivia_trailing attributes removed. |
|
WithoutTrailingTrivia ( this attrs, VList &trailingTrivia ) : VList |
Gets a new list with any #trivia_trailing attributes removed. Those trivia are returned in an `out` parameter. |
|