diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AbstractAntlrInnerNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AbstractAntlrInnerNode.java new file mode 100644 index 0000000000..36f4a833c6 --- /dev/null +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AbstractAntlrInnerNode.java @@ -0,0 +1,38 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.ast.impl.antlr4; + +/** + * + */ +public abstract class AbstractAntlrInnerNode> + extends AbstractAntlrNode { + + protected AbstractAntlrInnerNode(T parseTree) { + super(parseTree); + } + + @Override + public int getBeginLine() { + return getParseTree().start.getLine(); // This goes from 1 to n + } + + @Override + public int getEndLine() { + // FIXME this is not the end line if the stop token spans several lines + return getParseTree().stop.getLine(); + } + + @Override + public int getBeginColumn() { + return AntlrUtils.getBeginColumn(getParseTree().start); + } + + @Override + public int getEndColumn() { + return AntlrUtils.getEndColumn(getParseTree().stop); + } + +} diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AbstractAntlrNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AbstractAntlrNode.java index e7ca6b0575..83fcefb3e1 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AbstractAntlrNode.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AbstractAntlrNode.java @@ -5,16 +5,12 @@ package net.sourceforge.pmd.lang.ast.impl.antlr4; import net.sourceforge.pmd.lang.ast.impl.AbstractNode; -import net.sourceforge.pmd.lang.ast.impl.GenericNode; /** * */ -public abstract class AbstractAntlrNode< - B extends AbstractAntlrNode, - T extends AntlrParseTreeBase, - N extends GenericNode - > extends AbstractNode { +public abstract class AbstractAntlrNode> + extends AbstractNode, N> implements AntlrNode { private final T parseTree; @@ -22,14 +18,11 @@ public abstract class AbstractAntlrNode< this.parseTree = parseTree; } - @Override - protected void addChild(B child, int index) { + protected void addChild(AbstractAntlrNode child, int index) { super.addChild(child, index); } - public abstract R acceptVisitor(AntlrTreeVisitor visitor, P data); - public T getParseTree() { return parseTree; } @@ -41,25 +34,5 @@ public abstract class AbstractAntlrNode< '}'; } - @Override - public int getBeginLine() { - return parseTree.start.getLine(); // This goes from 1 to n - } - - @Override - public int getEndLine() { - // FIXME this is not the end line if the stop token spans several lines - return parseTree.stop.getLine(); - } - - @Override - public int getBeginColumn() { - return AntlrUtils.getBeginColumn(parseTree.start); - } - - @Override - public int getEndColumn() { - return AntlrUtils.getEndColumn(parseTree.stop); - } } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AbstractAntlrTerminalNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AbstractAntlrTerminalNode.java new file mode 100644 index 0000000000..1d3cb077bf --- /dev/null +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AbstractAntlrTerminalNode.java @@ -0,0 +1,40 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.ast.impl.antlr4; + +import org.antlr.v4.runtime.tree.TerminalNode; + +/** + * + */ +public abstract class AbstractAntlrTerminalNode> + extends AbstractAntlrNode { + + protected AbstractAntlrTerminalNode(TerminalNode parseTree) { + super(parseTree); + } + + @Override + public int getBeginLine() { + return getParseTree().getSymbol().getLine(); // This goes from 1 to n + } + + @Override + public int getEndLine() { + // FIXME this is not the end line if the stop token spans several lines + return getParseTree().getSymbol().getLine(); + } + + @Override + public int getBeginColumn() { + return AntlrUtils.getBeginColumn(getParseTree().getSymbol()); + } + + @Override + public int getEndColumn() { + return AntlrUtils.getEndColumn(getParseTree().getSymbol()); + } + +} diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrBaseParser.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrBaseParser.java index 5af0240f03..494dbe7eb4 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrBaseParser.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrBaseParser.java @@ -15,7 +15,6 @@ import net.sourceforge.pmd.lang.Parser; import net.sourceforge.pmd.lang.ParserOptions; import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.RootNode; -import net.sourceforge.pmd.lang.ast.impl.GenericNode; /** * Generic Antlr parser adapter for all Antlr parsers. This wraps a parser @@ -25,9 +24,8 @@ import net.sourceforge.pmd.lang.ast.impl.GenericNode; * @param Type of the root node */ public abstract class AntlrBaseParser< - N extends GenericNode, - B extends AbstractAntlrNode, - R extends AbstractAntlrNode & RootNode + N extends AntlrNode, + R extends AbstractAntlrNode & RootNode > implements Parser { protected final ParserOptions parserOptions; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrBaseRule.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrBaseRule.java index 851b0bd337..549865603e 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrBaseRule.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrBaseRule.java @@ -27,7 +27,7 @@ public abstract class AntlrBaseRule extends AbstractRule { for (Node node : nodes) { assert node instanceof AbstractAntlrNode : "Incorrect node type " + node + " passed to " + this; - ((AbstractAntlrNode) node).acceptVisitor(visitor, ctx); + ((AbstractAntlrNode) node).acceptVisitor(visitor, ctx); } } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrNode.java new file mode 100644 index 0000000000..408377bb34 --- /dev/null +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrNode.java @@ -0,0 +1,15 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.ast.impl.antlr4; + +import net.sourceforge.pmd.lang.ast.impl.GenericNode; + +/** + * + */ +public interface AntlrNode> extends GenericNode { + + R acceptVisitor(AntlrTreeVisitor visitor, P data); +} diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrParseTreeBase.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrParseTreeBase.java index a0e5883cb9..e0b9ea609e 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrParseTreeBase.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrParseTreeBase.java @@ -12,7 +12,7 @@ import org.antlr.v4.runtime.ParserRuleContext; */ public abstract class AntlrParseTreeBase extends ParserRuleContext { - AbstractAntlrNode pmdNode; + AntlrNode pmdNode; protected AntlrParseTreeBase() { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTreeBuilderState.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTreeBuilderListener.java similarity index 83% rename from pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTreeBuilderState.java rename to pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTreeBuilderListener.java index 0480f9b1fb..927a10e386 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTreeBuilderState.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrTreeBuilderListener.java @@ -16,7 +16,7 @@ import org.antlr.v4.runtime.tree.TerminalNode; /** * Don't extend me, compose me. */ -public class AntlrTreeBuilderState> implements ParseTreeListener { +public class AntlrTreeBuilderListener, N extends AntlrNode> implements ParseTreeListener { private final ParseTreeVisitor nodeFactory; @@ -26,7 +26,7 @@ public class AntlrTreeBuilderState> impleme private int sp = 0; private int mk = 0; - public AntlrTreeBuilderState(ParseTreeVisitor nodeFactory) { + public AntlrTreeBuilderListener(ParseTreeVisitor nodeFactory) { this.nodeFactory = nodeFactory; } @@ -36,7 +36,8 @@ public class AntlrTreeBuilderState> impleme @Override public void visitTerminal(TerminalNode node) { - + B toPush = nodeFactory.visitTerminal(node); + pushNode(toPush); } @Override @@ -46,6 +47,10 @@ public class AntlrTreeBuilderState> impleme @Override public void enterEveryRule(ParserRuleContext ctx) { + enterNode(); + } + + private void enterNode() { marks.push(mk); mk = sp; } @@ -55,6 +60,7 @@ public class AntlrTreeBuilderState> impleme B newNode = nodeFactory.visit(ctx); ((AntlrParseTreeBase) ctx).pmdNode = newNode; + int arity = nodeArity(); mk = marks.pop(); while (arity-- > 0) { diff --git a/pmd-swift/src/main/antlr4/net/sourceforge/pmd/lang/swift/ast/SwiftTree.g4 b/pmd-swift/src/main/antlr4/net/sourceforge/pmd/lang/swift/ast/SwiftTree.g4 index fdec28e6c0..6aaab33b9b 100644 --- a/pmd-swift/src/main/antlr4/net/sourceforge/pmd/lang/swift/ast/SwiftTree.g4 +++ b/pmd-swift/src/main/antlr4/net/sourceforge/pmd/lang/swift/ast/SwiftTree.g4 @@ -38,7 +38,6 @@ import net.sourceforge.pmd.lang.ast.impl.antlr4.*; } - @parser::members { public static final AntlrNameDictionary DICO = new AntlrNameDictionary(VOCABULARY, ruleNames); diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftHandler.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftHandler.java index 798e47e8d7..da9b2589b2 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftHandler.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftHandler.java @@ -7,12 +7,12 @@ package net.sourceforge.pmd.lang.swift; import net.sourceforge.pmd.lang.AbstractPmdLanguageVersionHandler; import net.sourceforge.pmd.lang.Parser; import net.sourceforge.pmd.lang.ParserOptions; -import net.sourceforge.pmd.lang.swift.ast.SwiftParserAdapter; +import net.sourceforge.pmd.lang.swift.ast.SwiftParser; public class SwiftHandler extends AbstractPmdLanguageVersionHandler { @Override public Parser getParser(final ParserOptions parserOptions) { - return new SwiftParserAdapter(parserOptions); + return new SwiftParser(parserOptions); } } diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwIdentifier.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwIdentifier.java new file mode 100644 index 0000000000..9543494fd0 --- /dev/null +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwIdentifier.java @@ -0,0 +1,23 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.swift.ast; + +import net.sourceforge.pmd.lang.swift.ast.SwiftTreeParser.IdentifierContext; + +public final class SwIdentifier extends SwiftInnerNode { + + SwIdentifier(IdentifierContext parseTreeNode) { + super(parseTreeNode); + } + + public String getName() { + return getParseTree().getText(); // single token + } + + @Override + public R acceptVisitor(SwiftVisitor visitor, P data) { + return visitor.visitIdent(this, data); + } +} diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftRootNode.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwRootNode.java similarity index 74% rename from pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftRootNode.java rename to pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwRootNode.java index 0a05d65dba..c2db8f2dc6 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftRootNode.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwRootNode.java @@ -7,9 +7,9 @@ package net.sourceforge.pmd.lang.swift.ast; import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.lang.swift.ast.SwiftTreeParser.TopLevelContext; -public final class SwiftRootNode extends SwiftNodeImpl implements RootNode { +public final class SwRootNode extends SwiftInnerNode implements RootNode { - public SwiftRootNode(TopLevelContext parseTreeNode) { + SwRootNode(TopLevelContext parseTreeNode) { super(parseTreeNode); } diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNodeImpl.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftInnerNode.java similarity index 52% rename from pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNodeImpl.java rename to pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftInnerNode.java index 2edb3856f3..6bf26c131a 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNodeImpl.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftInnerNode.java @@ -4,32 +4,22 @@ package net.sourceforge.pmd.lang.swift.ast; +import net.sourceforge.pmd.lang.ast.impl.antlr4.AbstractAntlrInnerNode; import net.sourceforge.pmd.lang.ast.impl.antlr4.AbstractAntlrNode; import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrParseTreeBase; -import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrTreeVisitor; -/** - * - */ -public class SwiftNodeImpl - extends AbstractAntlrNode, T, SwiftNode> +public class SwiftInnerNode + extends AbstractAntlrInnerNode> implements SwiftNode { - SwiftNodeImpl(T parseTreeNode) { + SwiftInnerNode(T parseTreeNode) { super(parseTreeNode); } - @Override - protected void addChild(SwiftNodeImpl child, int index) { - super.addChild(child, index); - } @Override - public final R acceptVisitor(AntlrTreeVisitor visitor, P data) { - if (visitor instanceof SwiftVisitor) { - return acceptVisitor((SwiftVisitor) visitor, data); - } - throw new IllegalArgumentException("Cannot accept visitor " + visitor); + protected void addChild(AbstractAntlrNode> child, int index) { + super.addChild(child, index); } @Override diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNode.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNode.java index 20e4733a96..7da290c36f 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNode.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNode.java @@ -4,19 +4,27 @@ package net.sourceforge.pmd.lang.swift.ast; -import net.sourceforge.pmd.lang.ast.impl.GenericNode; -import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrParseTreeBase; +import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrNode; +import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrTreeVisitor; /** * Supertype of all swift nodes. */ -public interface SwiftNode extends GenericNode> { - +public interface SwiftNode extends AntlrNode> { T getParseTree(); R acceptVisitor(SwiftVisitor visitor, P data); + + @Override + default R acceptVisitor(AntlrTreeVisitor visitor, P data) { + if (visitor instanceof SwiftVisitor) { + return acceptVisitor((SwiftVisitor) visitor, data); + } + throw new IllegalArgumentException("Cannot accept visitor " + visitor); + } + } diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNodeFactory.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNodeFactory.java index 94306f99a7..149236d4c6 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNodeFactory.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftNodeFactory.java @@ -5,12 +5,15 @@ package net.sourceforge.pmd.lang.swift.ast; import org.antlr.v4.runtime.tree.RuleNode; +import org.antlr.v4.runtime.tree.TerminalNode; +import net.sourceforge.pmd.lang.ast.impl.antlr4.AbstractAntlrNode; import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrParseTreeBase; +import net.sourceforge.pmd.lang.swift.ast.SwiftTreeParser.IdentifierContext; import net.sourceforge.pmd.lang.swift.ast.SwiftTreeParser.TopLevelContext; -final class SwiftNodeFactory extends SwiftTreeBaseVisitor> { +final class SwiftNodeFactory extends SwiftTreeBaseVisitor>> { static final SwiftNodeFactory INSTANCE = new SwiftNodeFactory(); @@ -19,13 +22,23 @@ final class SwiftNodeFactory extends SwiftTreeBaseVisitor> { } @Override - public SwiftNodeImpl visitTopLevel(TopLevelContext ctx) { - return new SwiftRootNode(ctx); + public SwiftTerminal visitTerminal(TerminalNode node) { + return new SwiftTerminal(node); } @Override - public SwiftNodeImpl visitChildren(RuleNode node) { + public SwiftInnerNode visitIdentifier(IdentifierContext ctx) { + return new SwIdentifier(ctx); + } + + @Override + public SwiftInnerNode visitTopLevel(TopLevelContext ctx) { + return new SwRootNode(ctx); + } + + @Override + public SwiftInnerNode visitChildren(RuleNode node) { // default visit - return new SwiftNodeImpl<>((AntlrParseTreeBase) node); + return new SwiftInnerNode<>((AntlrParseTreeBase) node); } } diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftParserAdapter.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftParser.java similarity index 67% rename from pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftParserAdapter.java rename to pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftParser.java index 0081536be7..5c1da947d9 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftParserAdapter.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftParser.java @@ -10,24 +10,24 @@ import org.antlr.v4.runtime.Lexer; import net.sourceforge.pmd.lang.ParserOptions; import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrBaseParser; -import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrTreeBuilderState; +import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrTreeBuilderListener; /** * Adapter for the SwiftParser. */ -public final class SwiftParserAdapter extends AntlrBaseParser, SwiftNodeImpl, SwiftRootNode> { +public final class SwiftParser extends AntlrBaseParser, SwRootNode> { - public SwiftParserAdapter(final ParserOptions parserOptions) { + public SwiftParser(final ParserOptions parserOptions) { super(parserOptions); } @Override - protected SwiftRootNode parse(final Lexer lexer) { + protected SwRootNode parse(final Lexer lexer) { SwiftTreeParser parser = new SwiftTreeParser(new CommonTokenStream(lexer)); - AntlrTreeBuilderState listener = new AntlrTreeBuilderState<>(SwiftNodeFactory.INSTANCE); + AntlrTreeBuilderListener listener = new AntlrTreeBuilderListener<>(SwiftNodeFactory.INSTANCE); parser.addParseListener(listener); parser.topLevel(); - return (SwiftRootNode) listener.top(); + return (SwRootNode) listener.top(); } @Override diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftTerminal.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftTerminal.java new file mode 100644 index 0000000000..10c61145e6 --- /dev/null +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftTerminal.java @@ -0,0 +1,27 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.swift.ast; + +import org.antlr.v4.runtime.tree.TerminalNode; + +import net.sourceforge.pmd.lang.ast.impl.antlr4.AbstractAntlrTerminalNode; + +public final class SwiftTerminal extends AbstractAntlrTerminalNode> implements SwiftNode { + + SwiftTerminal(TerminalNode parseTreeNode) { + super(parseTreeNode); + } + + + @Override + public String getXPathNodeName() { + return SwiftTreeParser.DICO.getXPathNameOfToken(getParseTree().getSymbol().getType()); + } + + @Override + public R acceptVisitor(SwiftVisitor visitor, P data) { + return visitor.visitTerminal(this, data); + } +} diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftVisitor.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftVisitor.java index e65f0a4dfb..0b3ae1871f 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftVisitor.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/ast/SwiftVisitor.java @@ -11,10 +11,24 @@ import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrTreeVisitor; */ public interface SwiftVisitor extends AntlrTreeVisitor> { - - default R visitRoot(SwiftRootNode node, P data) { + default R visitTerminal(SwiftTerminal node, P data) { return visitAnyNode(node, data); } + default R visitInnerNode(SwiftInnerNode node, P data) { + return visitAnyNode(node, data); + } + + + default R visitRoot(SwRootNode node, P data) { + return visitInnerNode(node, data); + } + + + default R visitIdent(SwIdentifier node, P data) { + return visitInnerNode(node, data); + } + + } diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionRule.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionRule.java index 039a52b15a..9d71780b9a 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionRule.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/rule/bestpractices/UnavailableFunctionRule.java @@ -8,6 +8,7 @@ import java.util.List; import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.swift.AbstractSwiftRule; +import net.sourceforge.pmd.lang.swift.ast.SwiftInnerNode; import net.sourceforge.pmd.lang.swift.ast.SwiftNode; import net.sourceforge.pmd.lang.swift.ast.SwiftTreeParser; import net.sourceforge.pmd.lang.swift.ast.SwiftTreeParser.AttributeContext; @@ -34,8 +35,13 @@ public class UnavailableFunctionRule extends AbstractSwiftRule { return new SwiftVisitor() { @Override - @SuppressWarnings("unchecked") public Void visitAnyNode(SwiftNode swiftNode, RuleContext data) { + return null; + } + + @Override + @SuppressWarnings("unchecked") + public Void visitInnerNode(SwiftInnerNode swiftNode, RuleContext data) { switch (swiftNode.getParseTree().getRuleIndex()) { case SwiftTreeParser.RULE_functionDeclaration: return visitFunctionDeclaration((SwiftNode) swiftNode, data); diff --git a/pmd-swift/src/main/resources/category/swift/bestpractices.xml b/pmd-swift/src/main/resources/category/swift/bestpractices.xml index fded26b5ed..2de6f1dce9 100644 --- a/pmd-swift/src/main/resources/category/swift/bestpractices.xml +++ b/pmd-swift/src/main/resources/category/swift/bestpractices.xml @@ -26,9 +26,9 @@ Rules which enforce generally accepted best practices. - //VariableDeclarationHead/Attributes/Attribute[T-at-symbol and AttributeName/*/T-Identifier/@Text = "IBOutlet"] + //VariableDeclarationHead/Attributes/Attribute[AttributeName/Identifier[@Name = "IBOutlet"]] | - //FunctionHead/Attributes/Attribute[T-at-symbol and AttributeName/*/T-Identifier/@Text = "IBAction"] + //FunctionHead/Attributes/Attribute[AttributeName/Identifier[@Name = "IBAction"]] diff --git a/pmd-swift/src/main/resources/category/swift/errorprone.xml b/pmd-swift/src/main/resources/category/swift/errorprone.xml index 5f471da610..485d01bdc3 100644 --- a/pmd-swift/src/main/resources/category/swift/errorprone.xml +++ b/pmd-swift/src/main/resources/category/swift/errorprone.xml @@ -25,7 +25,7 @@ diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParserTests.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParserTests.java index dfdadab64e..16063ed179 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParserTests.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParserTests.java @@ -16,4 +16,9 @@ public class SwiftParserTests extends BaseSwiftTreeDumpTest { doTest("Simple"); } + @Test + public void testBtree() { + doTest("BTree"); + } + } diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParsingHelper.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParsingHelper.java index a327bb136b..7cc06cd0d9 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParsingHelper.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/ast/SwiftParsingHelper.java @@ -12,13 +12,13 @@ import net.sourceforge.pmd.lang.swift.SwiftLanguageModule; /** * */ -public class SwiftParsingHelper extends BaseParsingHelper { +public class SwiftParsingHelper extends BaseParsingHelper { public static final SwiftParsingHelper DEFAULT = new SwiftParsingHelper(Params.getDefaultNoProcess()); public SwiftParsingHelper(@NotNull Params params) { - super(SwiftLanguageModule.NAME, SwiftRootNode.class, params); + super(SwiftLanguageModule.NAME, SwRootNode.class, params); } @NotNull diff --git a/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/ast/testdata/BTree.swift b/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/ast/testdata/BTree.swift new file mode 100644 index 0000000000..ceefe4f25e --- /dev/null +++ b/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/ast/testdata/BTree.swift @@ -0,0 +1,1015 @@ +// Downloaded on 2016/03/02 from https://github.com/lorentey/BTree/blame/master/Sources/BTree.swift +// +// BTree.swift +// BTree +// +// Created by Károly Lőrentey on 2016-02-19. +// Copyright © 2015–2016 Károly Lőrentey. +// + +/// B-trees are search trees that provide an ordered key-value store with excellent performance characteristics. +public struct BTree { + public typealias Element = (Key, Payload) + internal typealias Node = BTreeNode + + internal var root: Node + + internal init(_ root: Node) { + self.root = root + } + + /// Initialize a new b-tree with no elements. + /// + /// - Parameter order: The maximum number of children for tree nodes. + public init(order: Int = Node.defaultOrder) { + self.root = Node(order: order) + } + + /// The order of this tree, i.e., the maximum number of children for tree nodes. + public var order: Int { return root.order } + /// The depth of this tree. Depth starts at 0 for a tree that has a single root node. + public var depth: Int { return root.depth } +} + +//MAKE: Uniquing + +public extension BTree { + internal var isUnique: Bool { + mutating get { + return isUniquelyReferenced(&root) + } + } + + internal mutating func makeUnique() { + guard !isUnique else { return } + root = root.clone() + } +} + +//MARK: SequenceType + +extension BTree: SequenceType { + public typealias Generator = BTreeGenerator + + /// Returns true iff this tree has no elements. + public var isEmpty: Bool { return root.count == 0 } + + /// Returns a generator over the elements of this b-tree. Elements are sorted by key. + public func generate() -> Generator { + return Generator(BTreeStrongPath(root: root, position: 0)) + } + + /// Returns a generator starting at a specific index. + public func generate(from index: Index) -> Generator { + index.state.expectRoot(root) + return Generator(BTreeStrongPath(root: root, slotsFrom: index.state)) + } + + /// Returns a generator starting at a specific position. + public func generate(fromPosition position: Int) -> Generator { + return Generator(BTreeStrongPath(root: root, position: position)) + } + + /// Returns a generator starting at the element with the specified key. + /// If the tree contains no such element, the generator is positioned at the first element with a larger key. + /// If there are multiple elements with the same key, `selector` indicates which matching element to find. + public func generate(from key: Key, choosing selector: BTreeKeySelector = Any) -> Generator { + return Generator(BTreeStrongPath(root: root, key: key, choosing: selector)) + } + + /// Call `body` on each element in self in the same order as a for-in loop. + public func forEach(@noescape body: (Element) throws -> ()) rethrows { + try root.forEach(body) + } + + /// A version of `forEach` that allows `body` to interrupt iteration by returning `false`. + /// + /// - Returns: `true` iff `body` returned true for all elements in the tree. + public func forEach(@noescape body: (Element) throws -> Bool) rethrows -> Bool { + return try root.forEach(body) + } +} + +//MARK: CollectionType + +extension BTree: CollectionType { + public typealias Index = BTreeIndex + public typealias SubSequence = BTree + + /// The index of the first element of this tree. Elements are sorted by key. + /// + /// - Complexity: O(log(`count`)) + public var startIndex: Index { + return Index(BTreeWeakPath(startOf: root)) + } + + /// The index after the last element of this tree. (Equals `startIndex` when the tree is empty.) + /// + /// - Complexity: O(1) + public var endIndex: Index { + return Index(BTreeWeakPath(endOf: root)) + } + + /// The number of elements in this tree. + public var count: Int { + return root.count + } + + /// Returns the element at `index`. + /// + /// - Complexity: O(1) + public subscript(index: Index) -> Element { + get { + index.state.expectRoot(self.root) + return index.state.element + } + } + + /// Returns a tree consisting of elements in the specified range of indexes. + /// + /// - Complexity: O(log(`count`)) + public subscript(range: Range) -> BTree { + get { + return subtree(with: range) + } + } +} + +//MARK: Lookups + +/// When the tree contains multiple elements with the same key, you can use a key selector to specify +/// that you want to use the first or last matching element, or that you don't care which element you get. +/// (The latter is sometimes faster.) +public enum BTreeKeySelector { + /// Look for the first element that matches the key, or insert a new element before existing matches. + case First + /// Look for the last element that matches the key, or insert a new element after existing matches. + case Last + /// Look for the first element that has a greater key, or insert a new element after existing matches. + case After + /// Accept any element that matches the key. This is sometimes faster, because the search may stop before reaching + /// a leaf node. + case Any +} + +public extension BTree { + + /// Returns the first element in this tree, or `nil` if the tree is empty. + /// + /// - Complexity: O(log(`count`)) + public var first: Element? { + return root.first + } + + /// Returns the last element in this tree, or `nil` if the tree is empty. + /// + /// - Complexity: O(log(`count`)) + public var last: Element? { + return root.last + } + + /// Returns the element at `position`. + /// + /// - Requires: `position >= 0 && position < count` + /// - Complexity: O(log(`count`)) + @warn_unused_result + public func elementAtPosition(position: Int) -> Element { + precondition(position >= 0 && position < count) + var position = position + var node = root + while !node.isLeaf { + let slot = node.slotOfPosition(position) + if slot.match { + return node.elements[slot.index] + } + let child = node.children[slot.index] + position -= slot.position - child.count + node = child + } + return node.elements[position] + } + + /// Returns the payload of an element of this tree with the specified key, or `nil` if there is no such element. + /// If there are multiple elements with the same key, `selector` indicates which matching element to find. + /// + /// - Complexity: O(log(`count`)) + @warn_unused_result + public func payloadOf(key: Key, choosing selector: BTreeKeySelector = Any) -> Payload? { + switch selector { + case Any: + var node = root + while true { + let slot = node.slotOf(key, choosing: .First) + if let m = slot.match { + return node.elements[m].1 + } + if node.isLeaf { + break + } + node = node.children[slot.descend] + } + return nil + default: + var node = root + var lastmatch: Payload? = nil + while true { + let slot = node.slotOf(key, choosing: selector) + if let m = slot.match { + lastmatch = node.elements[m].1 + } + if node.isLeaf { + break + } + node = node.children[slot.descend] + } + return lastmatch + } + } + + /// Returns an index to an element in this tree with the specified key, or `nil` if there is no such element. + /// If there are multiple elements with the same key, `selector` indicates which matching element to find. + /// + /// - Complexity: O(log(`count`)) + @warn_unused_result + public func indexOf(key: Key, choosing selector: BTreeKeySelector = Any) -> Index? { + let path = BTreeWeakPath(root: root, key: key, choosing: selector) + guard !path.isAtEnd && (selector == .After || path.key == key) else { return nil } + return Index(path) + } + + /// Returns the position of the first element in this tree with the specified key, or `nil` if there is no such element. + /// If there are multiple elements with the same key, `selector` indicates which matching element to find. + /// + /// - Complexity: O(log(`count`)) + @warn_unused_result + public func positionOf(key: Key, choosing selector: BTreeKeySelector = Any) -> Int? { + var node = root + var position = 0 + var match: Int? = nil + while !node.isLeaf { + let slot = node.slotOf(key, choosing: selector) + let child = node.children[slot.descend] + if let m = slot.match { + let p = node.positionOfSlot(m) + match = position + p + position += p - (m == slot.descend ? node.children[m].count : 0) + } + else { + position += node.positionOfSlot(slot.descend) - child.count + } + node = child + } + let slot = node.slotOf(key, choosing: selector) + if let m = slot.match { + return position + m + } + return match + } + + /// Returns the position of the element at `index`. + /// + /// - Complexity: O(1) + @warn_unused_result + public func positionOfIndex(index: Index) -> Int { + index.state.expectRoot(root) + return index.state.position + } + + /// Returns the index of the element at `position`. + /// + /// - Requires: `position >= 0 && position <= count` + /// - Complexity: O(log(`count`)) + @warn_unused_result + public func indexOfPosition(position: Int) -> Index { + return Index(BTreeWeakPath(root: root, position: position)) + } +} + + +//MARK: Editing + +extension BTree { + /// Edit the tree at a path that is to be discovered on the way down, ensuring that all nodes on the path are + /// uniquely held by this tree. + /// This is a simple (but not easy, alas) interface that allows implementing basic editing operations using + /// recursion without adding a separate method on `BTreeNode` for each operation. + /// + /// Editing is split into two phases: the descent phase and the ascend phase. + /// + /// - During descent, the `descend` closure is called repeatedly to get the next child slot to drill down into. + /// When the closure returns `nil`, the phase stops and the ascend phase begins. + /// - During ascend, the `ascend` closure is called for each node for which `descend` returned non-nil, in reverse + /// order. + /// + /// - Parameter descend: A closure that, when given a node, returns the child slot toward which the editing should + /// continue descending, or `nil` if the descent should stop. The closure may set outside references to the + /// node it gets, and may modify the node as it likes; however, it shouldn't modify anything in the tree outside + /// the node's subtree, and it should not set outside references to the node's descendants. + /// - Parameter ascend: A closure that processes a step of ascending back towards the root. It receives a parent node + /// and the child slot from which this step is ascending. The closure may set outside references to the + /// node it gets, and may modify the subtree as it likes; however, it shouldn't modify anything in the tree outside + /// the node's subtree. + internal mutating func edit(@noescape descend descend: Node -> Int?, @noescape ascend: (Node, Int) -> Void) { + makeUnique() + root.edit(descend: descend, ascend: ascend) + } +} + +//MARK: Insertion + +extension BTree { + /// Insert the specified element into the tree at `position`. + /// + /// - Requires: The key of the supplied element does not violate the b-tree's ordering requirement. + /// (This is only verified in non-optimized builds.) + /// - Note: When you need to perform multiple modifications on the same tree, + /// `BTreeCursor` provides an alternative interface that's often more efficient. + /// - Complexity: O(log(`count`)) + public mutating func insert(element: Element, at position: Int) { + precondition(position >= 0 && position <= count) + makeUnique() + var pos = count - position + var splinter: BTreeSplinter? = nil + var element = element + edit( + descend: { node in + let slot = node.slotOfPosition(node.count - pos) + assert(slot.index == 0 || node.elements[slot.index - 1].0 <= element.0) + assert(slot.index == node.elements.count || node.elements[slot.index].0 >= element.0) + if !slot.match { + // Continue descending. + pos -= node.count - slot.position + return slot.index + } + if node.isLeaf { + // Found the insertion point. Insert, then start ascending. + node.insert(element, inSlot: slot.index) + if node.isTooLarge { + splinter = node.split() + } + return nil + } + // For internal nodes, put the new element in place of the old at the same position, + // then continue descending toward the next position, inserting the old element. + element = node.setElementInSlot(slot.index, to: element) + pos = node.children[slot.index + 1].count + return slot.index + 1 + }, + ascend: { node, slot in + node.count += 1 + if let s = splinter { + node.insert(s, inSlot: slot) + splinter = node.isTooLarge ? node.split() : nil + } + } + ) + if let s = splinter { + root = Node(left: root, separator: s.separator, right: s.node) + } + } + + /// Set the payload at `position`, and return the payload originally stored there. + /// + /// - Requires: `position < count` + /// - Note: When you need to perform multiple modifications on the same tree, + /// `BTreeCursor` provides an alternative interface that's often more efficient. + /// - Complexity: O(log(`count`)) + public mutating func setPayloadAt(position: Int, to payload: Payload) -> Payload { + precondition(position >= 0 && position < count) + makeUnique() + var pos = count - position + var old: Payload? = nil + edit( + descend: { node in + let slot = node.slotOfPosition(node.count - pos) + if !slot.match { + // Continue descending. + pos -= node.count - slot.position + return slot.index + } + old = node.elements[slot.index].1 + node.elements[slot.index].1 = payload + return nil + }, + ascend: { node, slot in + } + ) + return old! + } + + /// Insert `element` into the tree as a new element. + /// If the tree already contains elements with the same key, `selector` specifies where to put the new element. + /// + /// - Note: When you need to perform multiple modifications on the same tree, + /// `BTreeCursor` provides an alternative interface that's often more efficient. + /// - Complexity: O(log(`count`)) + public mutating func insert(element: Element, at selector: BTreeKeySelector = Any) { + makeUnique() + let selector: BTreeKeySelector = (selector == .First ? .First : .After) + var splinter: BTreeSplinter? = nil + edit( + descend: { node in + let slot = node.slotOf(element.0, choosing: selector) + if !node.isLeaf { + return slot.descend + } + node.insert(element, inSlot: slot.descend) + if node.isTooLarge { + splinter = node.split() + } + return nil + }, + ascend: { node, slot in + node.count += 1 + if let s = splinter { + node.insert(s, inSlot: slot) + splinter = node.isTooLarge ? node.split() : nil + } + } + ) + if let s = splinter { + root = Node(left: root, separator: s.separator, right: s.node) + } + } + + /// Insert `element` into the tree, replacing an element with the same key if there is one. + /// If the tree already contains multiple elements with the same key, `selector` specifies which one to replace. + /// + /// - Note: When you need to perform multiple modifications on the same tree, + /// `BTreeCursor` provides an alternative interface that's often more efficient. + /// - Complexity: O(log(`count`)) + public mutating func insertOrReplace(element: Element, at selector: BTreeKeySelector = Any) -> Payload? { + let selector = (selector == .After ? .Last : selector) + makeUnique() + var old: Payload? = nil + var match: (node: Node, slot: Int)? = nil + var splinter: BTreeSplinter? = nil + edit( + descend: { node in + let slot = node.slotOf(element.0, choosing: selector) + if node.isLeaf { + if let m = slot.match { + // We found the element we want to replace. + old = node.setElementInSlot(m, to: element).1 + match = nil + } + else if old == nil && match == nil { + // The tree contains no matching elements; insert a new one. + node.insert(element, inSlot: slot.descend) + if node.isTooLarge { + splinter = node.split() + } + } + return nil + } + if let m = slot.match { + if selector == Any { + // When we don't care about which element to replace, we stop the descent at the first match. + old = node.setElementInSlot(m, to: element).1 + return nil + } + // Otherwise remember this match and replace it during ascend if it's the last one. + match = (node, m) + } + return slot.descend + }, + ascend: { node, slot in + if let m = match { + // We're looking for the node that contains the last match. + if m.node === node { + // Found it; replace the matching element and cancel the search. + old = node.setElementInSlot(m.slot, to: element).1 + match = nil + } + } + else if old == nil { + // We're ascending from an insertion. + node.count += 1 + if let s = splinter { + node.insert(s, inSlot: slot) + splinter = node.isTooLarge ? node.split() : nil + } + } + } + ) + if let s = splinter { + root = Node(left: root, separator: s.separator, right: s.node) + } + return old + } +} + +//MARK: Removal + +extension BTree { + /// Remove and return the first element. + /// + /// - Complexity: O(log(`count`)) + public mutating func removeFirst() -> Element { + return removeAt(0) + } + + /// Remove and return the last element. + /// + /// - Complexity: O(log(`count`)) + public mutating func removeLast() -> Element { + return removeAt(count - 1) + } + + /// Remove and return the first element, or return `nil` if the tree is empty. + /// + /// - Complexity: O(log(`count`)) + public mutating func popFirst() -> Element? { + guard !isEmpty else { return nil } + return removeAt(0) + } + + /// Remove and return the first element, or return `nil` if the tree is empty. + /// + /// - Complexity: O(log(`count`)) + public mutating func popLast() -> Element? { + guard !isEmpty else { return nil } + return removeAt(count - 1) + } + + /// Remove and return the element at the specified position. + /// + /// - Note: When you need to perform multiple modifications on the same tree, + /// `BTreeCursor` provides an alternative interface that's often more efficient. + /// - Complexity: O(log(`count`)) + public mutating func removeAt(position: Int) -> Element { + precondition(position >= 0 && position < count) + makeUnique() + var pos = count - position + var matching: (node: Node, slot: Int)? = nil + var old: Element? = nil + edit( + descend: { node in + let slot = node.slotOfPosition(node.count - pos) + if !slot.match { + // No match yet; continue descending. + assert(!node.isLeaf) + pos -= node.count - slot.position + return slot.index + } + if node.isLeaf { + // The position we're looking for is in a leaf node; we can remove it directly. + old = node.removeSlot(slot.index) + return nil + } + // When the position happens to fall into an internal node, remember the match and continue + // removing the next position (which is guaranteed to be in a leaf node). + // We'll replace the removed element with this one during the ascend. + matching = (node, slot.index) + pos = node.children[slot.index + 1].count + return slot.index + 1 + }, + ascend: { node, slot in + node.count -= 1 + if let m = matching where m.node === node { + // We've removed the element at the next position; put it back in place of the + // element we actually want to remove. + old = node.setElementInSlot(m.slot, to: old!) + matching = nil + } + if node.children[slot].isTooSmall { + node.fixDeficiency(slot) + } + } + ) + if root.children.count == 1 { + assert(root.elements.count == 0) + root = root.children[0] + } + return old! + } + + /// Remove an element with the specified key, if it exists. + /// If there are multiple elements with the same key, `selector` indicates which matching element to remove. + /// + /// - Returns: The removed element, or `nil` if there was no element with `key` in the tree. + /// - Note: When you need to perform multiple modifications on the same tree, + /// `BTreeCursor` provides an alternative interface that's often more efficient. + /// - Complexity: O(log(`count`)) + public mutating func remove(key: Key, at selector: BTreeKeySelector = Any) -> Element? { + let selector = (selector == .After ? .Last : selector) + makeUnique() + var old: Element? = nil + var matching: (node: Node, slot: Int)? = nil + edit( + descend: { node in + let slot = node.slotOf(key, choosing: selector) + if node.isLeaf { + if let m = slot.match { + old = node.removeSlot(m) + matching = nil + } + else if matching != nil { + old = node.removeSlot(slot.descend == node.elements.count ? slot.descend - 1 : slot.descend) + } + return nil + } + if let m = slot.match { + matching = (node, m) + } + return slot.descend + }, + ascend: { node, slot in + if let o = old { + node.count -= 1 + if let m = matching where m.node === node { + old = node.setElementInSlot(m.slot, to: o) + matching = nil + } + if node.children[slot].isTooSmall { + node.fixDeficiency(slot) + } + } + } + ) + if root.children.count == 1 { + assert(root.elements.count == 0) + root = root.children[0] + } + return old + } + + /// Remove and return the element referenced by the given index. + /// + /// - Complexity: O(log(`count`)) + public mutating func removeAtIndex(index: Index) -> Element { + return withCursorAt(index) { cursor in + return cursor.remove() + } + } + + /// Remove all elements from this tree. + public mutating func removeAll() { + root = Node(order: root.order) + } +} + +//MARK: Subtree extraction + +extension BTree { + /// Returns a subtree containing the initial `maxLength` elements in this tree. + /// + /// If `maxLength` exceeds `self.count`, the result contains all the elements of `self`. + /// + /// - Complexity: O(log(`count`)) + public func prefix(maxLength: Int) -> BTree { + precondition(maxLength >= 0) + if maxLength == 0 { + return BTree(order: order) + } + if maxLength >= count { + return self + } + return BTreeStrongPath(root: root, position: maxLength).prefix() + } + + /// Returns a subtree containing all but the last `n` elements. + /// + /// - Complexity: O(log(`count`)) + public func dropLast(n: Int) -> BTree { + precondition(n >= 0) + return prefix(max(0, count - n)) + } + + /// Returns a subtree containing all elements before the specified index. + /// + /// - Complexity: O(log(`count`)) + public func prefixUpTo(end: Index) -> BTree { + end.state.expectRoot(root) + if end.state.isAtEnd { + return self + } + return end.state.prefix() + } + + /// Returns a subtree containing all elements whose key is less than `key`. + /// + /// - Complexity: O(log(`count`)) + public func prefixUpTo(end: Key) -> BTree { + let path = BTreeStrongPath(root: root, key: end, choosing: .First) + if path.isAtEnd { + return self + } + return path.prefix() + } + + /// Returns a subtree containing all elements at or before the specified index. + /// + /// - Complexity: O(log(`count`)) + public func prefixThrough(stop: Index) -> BTree { + return prefixUpTo(stop.successor()) + } + + /// Returns a subtree containing all elements whose key is less than or equal to `key`. + /// + /// - Complexity: O(log(`count`)) + public func prefixThrough(stop: Key) -> BTree { + let path = BTreeStrongPath(root: root, key: stop, choosing: .After) + if path.isAtEnd { + return self + } + return path.prefix() + } + + /// Returns a tree containing the final `maxLength` elements in this tree. + /// + /// If `maxLength` exceeds `self.count`, the result contains all the elements of `self`. + /// + /// - Complexity: O(log(`count`)) + public func suffix(maxLength: Int) -> BTree { + precondition(maxLength >= 0) + if maxLength == 0 { + return BTree(order: order) + } + if maxLength >= count { + return self + } + return BTreeStrongPath(root: root, position: count - maxLength - 1).suffix() + } + + /// Returns a subtree containing all but the first `n` elements. + /// + /// - Complexity: O(log(`count`)) + public func dropFirst(n: Int) -> BTree { + precondition(n >= 0) + return suffix(max(0, count - n)) + } + + /// Returns a subtree containing all elements at or after the specified index. + /// + /// - Complexity: O(log(`count`)) + public func suffixFrom(start: Index) -> BTree { + start.state.expectRoot(root) + if start.state.position == 0 { + return self + } + return start.predecessor().state.suffix() + } + + /// Returns a subtree containing all elements whose key is greater than or equal to `key`. + /// + /// - Complexity: O(log(`count`)) + public func suffixFrom(start: Key) -> BTree { + var path = BTreeStrongPath(root: root, key: start, choosing: .First) + if path.isAtStart { + return self + } + path.moveBackward() + return path.suffix() + } + + /// Return a subtree consisting of elements in the specified range of indexes. + /// + /// - Complexity: O(log(`count`)) + @warn_unused_result + public func subtree(with range: Range) -> BTree { + range.startIndex.state.expectRoot(root) + range.endIndex.state.expectRoot(root) + let start = range.startIndex.state.position + let end = range.endIndex.state.position + precondition(0 <= start && start <= end && end <= self.count) + if start == end { + return BTree(order: self.order) + } + if start == 0 { + return prefixUpTo(range.endIndex) + } + return suffixFrom(range.startIndex).prefix(end - start) + } + + /// Return a subtree consisting of elements in the specified range of positions. + /// + /// - Complexity: O(log(`count`)) + @warn_unused_result + public func subtree(with positions: Range) -> BTree { + precondition(positions.startIndex >= 0 && positions.endIndex <= count) + if positions.count == 0 { + return BTree(order: order) + } + return dropFirst(positions.startIndex).prefix(positions.count) + } + + /// Return a subtree consisting of all elements with keys greater than or equal to `start` but less than `end`. + /// + /// - Complexity: O(log(`count`)) + @warn_unused_result + public func subtree(from start: Key, to end: Key) -> BTree { + precondition(start <= end) + return suffixFrom(start).prefixUpTo(end) + } + + /// Return a submap consisting of all elements with keys greater than or equal to `start` but less than or equal to `end`. + /// + /// - Complexity: O(log(`count`)) + @warn_unused_result + public func subtree(from start: Key, through stop: Key) -> BTree { + precondition(start <= stop) + return suffixFrom(start).prefixThrough(stop) + } +} + +//MARK: Bulk loading + +extension BTree { + /// Create a new b-tree from elements of an unsorted sequence, using a stable sort algorithm. + /// + /// - Parameter elements: An unsorted sequence of arbitrary length. + /// - Parameter order: The desired b-tree order. If not specified (recommended), the default order is used. + /// - Complexity: O(count * log(`count`)) + /// - SeeAlso: `init(sortedElements:order:fillFactor:)` for a (faster) variant that can be used if the sequence is already sorted. + public init(_ elements: S, dropDuplicates: Bool = false, order: Int = Node.defaultOrder) { + self.init(Node(order: order)) + withCursorAtEnd { cursor in + for element in elements { + cursor.move(to: element.0, choosing: .Last) + let match = !cursor.isAtEnd && cursor.key == element.0 + if match { + if dropDuplicates { + cursor.element = element + } + else { + cursor.insertAfter(element) + } + } + else { + cursor.insert(element) + } + } + } + } + + /// Create a new b-tree from elements of a sequence sorted by key. + /// + /// - Parameter sortedElements: A sequence of arbitrary length, sorted by key. + /// - Parameter order: The desired b-tree order. If not specified (recommended), the default order is used. + /// - Parameter fillFactor: The desired fill factor in each node of the new tree. Must be between 0.5 and 1.0. + /// If not specified, a value of 1.0 is used, i.e., nodes will be loaded with as many elements as possible. + /// - Complexity: O(count) + /// - SeeAlso: `init(elements:order:fillFactor:)` for a (slower) unsorted variant. + public init(sortedElements elements: S, dropDuplicates: Bool = false, order: Int = Node.defaultOrder, fillFactor: Double = 1) { + var generator = elements.generate() + self.init(order: order, fillFactor: fillFactor, dropDuplicates: dropDuplicates, next: { generator.next() }) + } + + internal init(order: Int = Node.defaultOrder, fillFactor: Double = 1, dropDuplicates: Bool = false, @noescape next: () -> Element?) { + precondition(order > 1) + precondition(fillFactor >= 0.5 && fillFactor <= 1) + let keysPerNode = Int(fillFactor * Double(order - 1) + 0.5) + assert(keysPerNode >= (order - 1) / 2 && keysPerNode <= order - 1) + + var builder = BTreeBuilder(order: order, keysPerNode: keysPerNode) + if dropDuplicates { + guard var buffer = next() else { + self.init(Node(order: order)) + return + } + while let element = next() { + precondition(buffer.0 <= element.0) + if buffer.0 < element.0 { + builder.append(buffer) + } + buffer = element + } + builder.append(buffer) + } + else { + var lastKey: Key? = nil + while let element = next() { + precondition(lastKey <= element.0) + lastKey = element.0 + builder.append(element) + } + } + self.init(builder.finish()) + } +} + +/// Swift 4 news + + +extension BTree { + + // Multi-line String Literals + + func multiline() { + let star = "⭐️" + let introString = """ + A long time ago in a galaxy far, + far away.... + + You could write multi-lined strings + without "escaping" single quotes. + + The indentation of the closing quotes + below deside where the text line + begins. + + You can even dynamically add values + from properties: \(star) + """ + print(introString) // prints the string exactly as written above with the value of star + } + + // One-Sided Ranges + + func planets() { + var planets = ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] + let outsideAsteroidBelt = planets[4...] // Before: planets[4.. { + private var data: [Key: Value] + + init(data: [Key: Value]) { + self.data = data + } + + subscript(key: Key) -> T? { + return data[key] as? T + } +} + +func useSomeGenericSubscript() { + // Dictionary of type: [String: Any] + var earthData = GenericDictionary(data: ["name": "Earth", "population": 7500000000, "moons": 1]) + + // Automatically infers return type without "as? String" + let name: String? = earthData["name"] + + // Automatically infers return type without "as? Int" + let population: Int? = earthData["population"] +} + +extension GenericDictionary { + subscript(keys: Keys) -> [Value] where Keys.Iterator.Element == Key { + var values: [Value] = [] + for key in keys { + if let value = data[key] { + values.append(value) + } + } + return values + } +} + +func useSomeGenericFromExtension() { + // Array subscript value + let nameAndMoons = earthData[["moons", "name"]] // [1, "Earth"] + // Set subscript value + let nameAndMoons2 = earthData[Set(["moons", "name"])] // [1, "Earth"] +} + +// Associated Type Constraints + +protocol MyProtocol { + associatedtype Element + associatedtype SubSequence : Sequence where SubSequence.Iterator.Element == Iterator.Element +} + +// Class and Protocol Existential + +protocol MyProtocol { } +class View { } +class ViewSubclass: View, MyProtocol { } + +class MyClass { + var delegate: (View & MyProtocol)? +} + +let myClass = MyClass() +//myClass.delegate = View() // error: cannot assign value of type 'View' to type '(View & MyProtocol)?' +myClass.delegate = ViewSubclass() + +// 4.1 conditional + +#if canImport(SomeModule) +let someModuleImportedVersion = SomeModule.version +#endif + +#if targetEnvironment(simulator) +print("code only compiled for simulator") +#endif diff --git a/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/ast/testdata/BTree.txt b/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/ast/testdata/BTree.txt new file mode 100644 index 0000000000..0d55213d5f --- /dev/null +++ b/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/ast/testdata/BTree.txt @@ -0,0 +1,3908 @@ ++- TopLevel + +- Statements + +- Statement + | +- Declaration + | +- StructDeclaration + | +- AccessLevelModifier + | | +- T-public + | +- T-struct + | +- StructName + | | +- Identifier + | | +- T-Identifier + | +- GenericParameterClause + | | +- T-lt + | | +- GenericParameterList + | | | +- GenericParameter + | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-colon + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-comma + | | | +- GenericParameter + | | | +- TypeName + | | | +- Identifier + | | | +- T-Identifier + | | +- T-gt + | +- StructBody + | +- T-lbrace + | +- StructMembers + | | +- StructMember + | | | +- Declaration + | | | +- TypealiasDeclaration + | | | +- TypealiasHead + | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-typealias + | | | | +- TypealiasName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypealiasAssignment + | | | +- T-eq + | | | +- SType + | | | +- TupleType + | | | +- T-lparen + | | | +- TupleTypeElementList + | | | | +- TupleTypeElement + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-comma + | | | | +- TupleTypeElement + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rparen + | | +- StructMember + | | | +- Declaration + | | | +- TypealiasDeclaration + | | | +- TypealiasHead + | | | | +- AccessLevelModifier + | | | | | +- T-internal + | | | | +- T-typealias + | | | | +- TypealiasName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypealiasAssignment + | | | +- T-eq + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- GenericArgumentClause + | | | +- T-lt + | | | +- GenericArgumentList + | | | | +- GenericArgument + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-comma + | | | | +- GenericArgument + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-gt + | | +- StructMember + | | | +- Declaration + | | | +- VariableDeclaration + | | | +- VariableDeclarationHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-internal + | | | | +- T-var + | | | +- PatternInitializerList + | | | +- PatternInitializer + | | | +- Pattern + | | | +- IdentifierPattern + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypeAnnotation + | | | +- T-colon + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | +- Identifier + | | | +- T-Identifier + | | +- StructMember + | | | +- Declaration + | | | +- InitializerDeclaration + | | | +- InitializerHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-internal + | | | | +- T-init + | | | +- ParameterClause + | | | | +- T-lparen + | | | | +- ParameterList + | | | | | +- Parameter + | | | | | +- ExternalParameterName + | | | | | | +- Keyword + | | | | | | +- T-underscore + | | | | | +- LocalParameterName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- TypeAnnotation + | | | | | +- T-colon + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- InitializerBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Keyword + | | | | | | +- T-self + | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- PostfixOperator + | | | | | +- Operator + | | | | | +- OperatorHead + | | | | | +- T-eq + | | | | +- Statement + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | +- PrimaryExpression + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rbrace + | | +- StructMember + | | | +- Declaration + | | | +- InitializerDeclaration + | | | +- InitializerHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-init + | | | +- ParameterClause + | | | | +- T-lparen + | | | | +- ParameterList + | | | | | +- Parameter + | | | | | +- LocalParameterName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- TypeAnnotation + | | | | | | +- T-colon + | | | | | | +- SType + | | | | | | +- TypeIdentifier + | | | | | | +- TypeName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- DefaultArgumentClause + | | | | | +- T-eq + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- T-dot + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- InitializerBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Keyword + | | | | | | +- T-self + | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- PostfixOperator + | | | | | +- Operator + | | | | | +- OperatorHead + | | | | | +- T-eq + | | | | +- Statement + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | +- FunctionCallIdentifier + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-colon + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- T-rbrace + | | +- StructMember + | | | +- Declaration + | | | +- VariableDeclaration + | | | +- VariableDeclarationHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-var + | | | +- VariableName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypeAnnotation + | | | | +- T-colon + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- T-dot + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rbrace + | | +- StructMember + | | +- Declaration + | | +- VariableDeclaration + | | +- VariableDeclarationHead + | | | +- DeclarationModifiers + | | | | +- DeclarationModifier + | | | | +- AccessLevelModifier + | | | | +- T-public + | | | +- T-var + | | +- VariableName + | | | +- Identifier + | | | +- T-Identifier + | | +- TypeAnnotation + | | | +- T-colon + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | +- Identifier + | | | +- T-Identifier + | | +- CodeBlock + | | +- T-lbrace + | | +- Statements + | | | +- Statement + | | | +- ControlTransferStatement + | | | +- ReturnStatement + | | | +- T-return + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | | +- PrimaryExpression + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- PostfixExpression + | | | +- T-dot + | | | +- Identifier + | | | +- T-Identifier + | | +- T-rbrace + | +- T-rbrace + +- Statement + | +- Declaration + | +- ExtensionDeclaration + | +- AccessLevelModifier + | | +- T-public + | +- T-extension + | +- TypeIdentifier + | | +- TypeName + | | +- Identifier + | | +- T-Identifier + | +- ExtensionBody + | +- T-lbrace + | +- ExtensionMembers + | | +- ExtensionMember + | | | +- Declaration + | | | +- VariableDeclaration + | | | +- VariableDeclarationHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-internal + | | | | +- T-var + | | | +- VariableName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypeAnnotation + | | | | +- T-colon + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- GetterSetterBlock + | | | +- T-lbrace + | | | +- GetterClause + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- MutationModifier + | | | | | +- T-mutating + | | | | +- T-get + | | | | +- CodeBlock + | | | | +- T-lbrace + | | | | +- Statements + | | | | | +- Statement + | | | | | +- ControlTransferStatement + | | | | | +- ReturnStatement + | | | | | +- T-return + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PrefixOperator + | | | | | | | +- Operator + | | | | | | | +- OperatorHead + | | | | | | | +- T-amp + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- T-rbrace + | | | +- T-rbrace + | | +- ExtensionMember + | | +- Declaration + | | +- FunctionDeclaration + | | +- FunctionHead + | | | +- DeclarationModifiers + | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-internal + | | | | +- DeclarationModifier + | | | | +- MutationModifier + | | | | +- T-mutating + | | | +- T-func + | | +- FunctionName + | | | +- Identifier + | | | +- T-Identifier + | | +- FunctionSignature + | | | +- ParameterClause + | | | +- T-lparen + | | | +- T-rparen + | | +- FunctionBody + | | +- CodeBlock + | | +- T-lbrace + | | +- Statements + | | | +- Statement + | | | | +- BranchStatement + | | | | +- GuardStatement + | | | | +- T-guard + | | | | +- ConditionList + | | | | | +- Condition + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PrefixOperator + | | | | | | +- Operator + | | | | | | +- OperatorHead + | | | | | | +- T-bang + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-else + | | | | +- CodeBlock + | | | | +- T-lbrace + | | | | +- Statements + | | | | | +- Statement + | | | | | +- ControlTransferStatement + | | | | | +- ReturnStatement + | | | | | +- T-return + | | | | +- T-rbrace + | | | +- Statement + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- PostfixOperator + | | | | +- Operator + | | | | +- OperatorHead + | | | | +- T-eq + | | | +- Statement + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | | +- PrimaryExpression + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- PostfixExpression + | | | | +- T-dot + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- PostfixExpression + | | | +- FunctionCallArgumentClause + | | | +- T-lparen + | | | +- T-rparen + | | +- T-rbrace + | +- T-rbrace + +- Statement + | +- Declaration + | +- ExtensionDeclaration + | +- T-extension + | +- TypeIdentifier + | | +- TypeName + | | +- Identifier + | | +- T-Identifier + | +- TypeInheritanceClause + | | +- T-colon + | | +- TypeInheritanceList + | | +- TypeIdentifier + | | +- TypeName + | | +- Identifier + | | +- T-Identifier + | +- ExtensionBody + | +- T-lbrace + | +- ExtensionMembers + | | +- ExtensionMember + | | | +- Declaration + | | | +- TypealiasDeclaration + | | | +- TypealiasHead + | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-typealias + | | | | +- TypealiasName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypealiasAssignment + | | | +- T-eq + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- GenericArgumentClause + | | | +- T-lt + | | | +- GenericArgumentList + | | | | +- GenericArgument + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-comma + | | | | +- GenericArgument + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-gt + | | +- ExtensionMember + | | | +- Declaration + | | | +- VariableDeclaration + | | | +- VariableDeclarationHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-var + | | | +- VariableName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypeAnnotation + | | | | +- T-colon + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | | +- ControlTransferStatement + | | | | | +- ReturnStatement + | | | | | +- T-return + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- PostfixOperator + | | | | | +- Operator + | | | | | +- OperatorHead + | | | | | +- T-double-eq + | | | | +- Statement + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | +- PrimaryExpression + | | | | +- LiteralExpression + | | | | +- Literal + | | | | +- NumericLiteral + | | | | +- IntegerLiteral + | | | | +- T-DecimalLiteral + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- FunctionDeclaration + | | | +- FunctionHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-func + | | | +- FunctionName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionSignature + | | | | +- ParameterClause + | | | | | +- T-lparen + | | | | | +- T-rparen + | | | | +- FunctionResult + | | | | +- T-rarrow + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | | +- FunctionCallIdentifier + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-colon + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- FunctionCallArgument + | | | | | | +- FunctionCallIdentifier + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-colon + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- LiteralExpression + | | | | | | +- Literal + | | | | | | +- NumericLiteral + | | | | | | +- IntegerLiteral + | | | | | | +- T-DecimalLiteral + | | | | | +- T-rparen + | | | | +- T-rparen + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- FunctionDeclaration + | | | +- FunctionHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-func + | | | +- FunctionName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionSignature + | | | | +- ParameterClause + | | | | | +- T-lparen + | | | | | +- ParameterList + | | | | | | +- Parameter + | | | | | | +- ExternalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- LocalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- TypeAnnotation + | | | | | | +- T-colon + | | | | | | +- SType + | | | | | | +- TypeIdentifier + | | | | | | +- TypeName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- FunctionResult + | | | | +- T-rarrow + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | | +- FunctionCallIdentifier + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-colon + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- FunctionCallArgument + | | | | | | +- FunctionCallIdentifier + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-colon + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- T-rparen + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- FunctionDeclaration + | | | +- FunctionHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-func + | | | +- FunctionName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionSignature + | | | | +- ParameterClause + | | | | | +- T-lparen + | | | | | +- ParameterList + | | | | | | +- Parameter + | | | | | | +- ExternalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- LocalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- TypeAnnotation + | | | | | | +- T-colon + | | | | | | +- SType + | | | | | | +- TypeIdentifier + | | | | | | +- TypeName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- FunctionResult + | | | | +- T-rarrow + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | | +- FunctionCallIdentifier + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-colon + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- FunctionCallArgument + | | | | | | +- FunctionCallIdentifier + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-colon + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- T-rparen + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- FunctionDeclaration + | | | +- FunctionHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-func + | | | +- FunctionName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionSignature + | | | | +- ParameterClause + | | | | | +- T-lparen + | | | | | +- ParameterList + | | | | | | +- Parameter + | | | | | | | +- ExternalParameterName + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- LocalParameterName + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- TypeAnnotation + | | | | | | | +- T-colon + | | | | | | | +- SType + | | | | | | | +- TypeIdentifier + | | | | | | | +- TypeName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- Parameter + | | | | | | +- ExternalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- LocalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- TypeAnnotation + | | | | | | | +- T-colon + | | | | | | | +- SType + | | | | | | | +- TypeIdentifier + | | | | | | | +- TypeName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- DefaultArgumentClause + | | | | | | +- T-eq + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Keyword + | | | | | | +- T-Any + | | | | | +- T-rparen + | | | | +- FunctionResult + | | | | +- T-rarrow + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | | +- FunctionCallIdentifier + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-colon + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- FunctionCallArgument + | | | | | | | +- FunctionCallIdentifier + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-colon + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- FunctionCallArgument + | | | | | | +- FunctionCallIdentifier + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-colon + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- T-rparen + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- FunctionDeclaration + | | | +- FunctionHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-func + | | | +- FunctionName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionSignature + | | | | +- ParameterClause + | | | | | +- T-lparen + | | | | | +- ParameterList + | | | | | | +- Parameter + | | | | | | +- Attributes + | | | | | | | +- Attribute + | | | | | | | +- T-at-symbol + | | | | | | | +- AttributeName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- LocalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- TypeAnnotation + | | | | | | +- T-colon + | | | | | | +- SType + | | | | | | +- FunctionType + | | | | | | +- FunctionTypeArgumentClause + | | | | | | | +- T-lparen + | | | | | | | +- FunctionTypeArgumentList + | | | | | | | | +- FunctionTypeArgument + | | | | | | | | +- SType + | | | | | | | | +- TypeIdentifier + | | | | | | | | +- TypeName + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-rparen + | | | | | | +- T-throws + | | | | | | +- T-rarrow + | | | | | | +- SType + | | | | | | +- TupleType + | | | | | | +- T-lparen + | | | | | | +- T-rparen + | | | | | +- T-rparen + | | | | +- T-rethrows + | | | +- FunctionBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- Expression + | | | | +- TryOperator + | | | | | +- T-try + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | | +- T-dot + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- T-rbrace + | | +- ExtensionMember + | | +- Declaration + | | +- FunctionDeclaration + | | +- FunctionHead + | | | +- DeclarationModifiers + | | | | +- DeclarationModifier + | | | | +- AccessLevelModifier + | | | | +- T-public + | | | +- T-func + | | +- FunctionName + | | | +- Identifier + | | | +- T-Identifier + | | +- FunctionSignature + | | | +- ParameterClause + | | | | +- T-lparen + | | | | +- ParameterList + | | | | | +- Parameter + | | | | | +- Attributes + | | | | | | +- Attribute + | | | | | | +- T-at-symbol + | | | | | | +- AttributeName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- LocalParameterName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- TypeAnnotation + | | | | | +- T-colon + | | | | | +- SType + | | | | | +- FunctionType + | | | | | +- FunctionTypeArgumentClause + | | | | | | +- T-lparen + | | | | | | +- FunctionTypeArgumentList + | | | | | | | +- FunctionTypeArgument + | | | | | | | +- SType + | | | | | | | +- TypeIdentifier + | | | | | | | +- TypeName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-rparen + | | | | | +- T-throws + | | | | | +- T-rarrow + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- T-rethrows + | | | +- FunctionResult + | | | +- T-rarrow + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | +- Identifier + | | | +- T-Identifier + | | +- FunctionBody + | | +- CodeBlock + | | +- T-lbrace + | | +- Statements + | | | +- Statement + | | | +- ControlTransferStatement + | | | +- ReturnStatement + | | | +- T-return + | | | +- Expression + | | | +- TryOperator + | | | | +- T-try + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | | +- PrimaryExpression + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- PostfixExpression + | | | | +- T-dot + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- PostfixExpression + | | | +- FunctionCallArgumentClause + | | | +- T-lparen + | | | +- FunctionCallArgumentList + | | | | +- FunctionCallArgument + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | +- PrimaryExpression + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rparen + | | +- T-rbrace + | +- T-rbrace + +- Statement + | +- Declaration + | +- ExtensionDeclaration + | +- T-extension + | +- TypeIdentifier + | | +- TypeName + | | +- Identifier + | | +- T-Identifier + | +- TypeInheritanceClause + | | +- T-colon + | | +- TypeInheritanceList + | | +- TypeIdentifier + | | +- TypeName + | | +- Identifier + | | +- T-Identifier + | +- ExtensionBody + | +- T-lbrace + | +- ExtensionMembers + | | +- ExtensionMember + | | | +- Declaration + | | | +- TypealiasDeclaration + | | | +- TypealiasHead + | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-typealias + | | | | +- TypealiasName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypealiasAssignment + | | | +- T-eq + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- GenericArgumentClause + | | | +- T-lt + | | | +- GenericArgumentList + | | | | +- GenericArgument + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-comma + | | | | +- GenericArgument + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-gt + | | +- ExtensionMember + | | | +- Declaration + | | | +- TypealiasDeclaration + | | | +- TypealiasHead + | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-typealias + | | | | +- TypealiasName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypealiasAssignment + | | | +- T-eq + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- GenericArgumentClause + | | | +- T-lt + | | | +- GenericArgumentList + | | | | +- GenericArgument + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-comma + | | | | +- GenericArgument + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-gt + | | +- ExtensionMember + | | | +- Declaration + | | | +- VariableDeclaration + | | | +- VariableDeclarationHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-var + | | | +- VariableName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypeAnnotation + | | | | +- T-colon + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | +- FunctionCallIdentifier + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-colon + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- T-rparen + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- VariableDeclaration + | | | +- VariableDeclarationHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-var + | | | +- VariableName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypeAnnotation + | | | | +- T-colon + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | +- FunctionCallIdentifier + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-colon + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- T-rparen + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- VariableDeclaration + | | | +- VariableDeclarationHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-var + | | | +- VariableName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypeAnnotation + | | | | +- T-colon + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- T-dot + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- SubscriptDeclaration + | | | +- SubscriptHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-subscript + | | | | +- ParameterClause + | | | | +- T-lparen + | | | | +- ParameterList + | | | | | +- Parameter + | | | | | +- LocalParameterName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- TypeAnnotation + | | | | | +- T-colon + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- SubscriptResult + | | | | +- T-rarrow + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- GetterSetterBlock + | | | +- T-lbrace + | | | +- GetterClause + | | | | +- T-get + | | | | +- CodeBlock + | | | | +- T-lbrace + | | | | +- Statements + | | | | | +- Statement + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- PostfixExpression + | | | | | | | +- T-dot + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- PostfixExpression + | | | | | | | +- T-dot + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- PostfixExpression + | | | | | | +- FunctionCallArgumentClause + | | | | | | +- T-lparen + | | | | | | +- FunctionCallArgumentList + | | | | | | | +- FunctionCallArgument + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Keyword + | | | | | | | | +- T-self + | | | | | | | +- PostfixExpression + | | | | | | | +- T-dot + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-rparen + | | | | | +- Statement + | | | | | +- ControlTransferStatement + | | | | | +- ReturnStatement + | | | | | +- T-return + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- T-dot + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rbrace + | | | +- T-rbrace + | | +- ExtensionMember + | | +- Declaration + | | +- SubscriptDeclaration + | | +- SubscriptHead + | | | +- DeclarationModifiers + | | | | +- DeclarationModifier + | | | | +- AccessLevelModifier + | | | | +- T-public + | | | +- T-subscript + | | | +- ParameterClause + | | | +- T-lparen + | | | +- ParameterList + | | | | +- Parameter + | | | | +- LocalParameterName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- TypeAnnotation + | | | | +- T-colon + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- GenericArgumentClause + | | | | +- T-lt + | | | | +- GenericArgumentList + | | | | | +- GenericArgument + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-gt + | | | +- T-rparen + | | +- SubscriptResult + | | | +- T-rarrow + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- GenericArgumentClause + | | | +- T-lt + | | | +- GenericArgumentList + | | | | +- GenericArgument + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-comma + | | | | +- GenericArgument + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-gt + | | +- GetterSetterBlock + | | +- T-lbrace + | | +- GetterClause + | | | +- T-get + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | +- FunctionCallIdentifier + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-colon + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- T-rbrace + | | +- T-rbrace + | +- T-rbrace + +- Statement + | +- Expression + | +- PrefixExpression + | +- PostfixExpression + | +- PrimaryExpression + | +- Keyword + | +- T-public + +- Statement + | +- Expression + | +- PrefixExpression + | +- PostfixExpression + | +- PrimaryExpression + | +- Keyword + | +- T-enum + +- Statement + | +- Expression + | +- PrefixExpression + | +- PostfixExpression + | | +- PrimaryExpression + | | +- Identifier + | | +- T-Identifier + | +- PostfixExpression + | +- ClosureExpression + | +- T-lbrace + | +- Statements + | | +- Statement + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | +- PrimaryExpression + | | | +- Keyword + | | | +- T-case + | | +- Statement + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | +- PrimaryExpression + | | | +- Identifier + | | | +- T-Identifier + | | +- Statement + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | +- PrimaryExpression + | | | +- Keyword + | | | +- T-case + | | +- Statement + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | +- PrimaryExpression + | | | +- Identifier + | | | +- T-Identifier + | | +- Statement + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | +- PrimaryExpression + | | | +- Keyword + | | | +- T-case + | | +- Statement + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | +- PrimaryExpression + | | | +- Identifier + | | | +- T-Identifier + | | +- Statement + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | +- PrimaryExpression + | | | +- Keyword + | | | +- T-case + | | +- Statement + | | +- Expression + | | +- PrefixExpression + | | +- PostfixExpression + | | +- PrimaryExpression + | | +- Keyword + | | +- T-Any + | +- T-rbrace + +- Statement + | +- Declaration + | +- ExtensionDeclaration + | +- AccessLevelModifier + | | +- T-public + | +- T-extension + | +- TypeIdentifier + | | +- TypeName + | | +- Identifier + | | +- T-Identifier + | +- ExtensionBody + | +- T-lbrace + | +- ExtensionMembers + | | +- ExtensionMember + | | | +- Declaration + | | | +- VariableDeclaration + | | | +- VariableDeclarationHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-var + | | | +- VariableName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypeAnnotation + | | | | +- T-colon + | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- SType + | | | | +- T-question + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- T-dot + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- VariableDeclaration + | | | +- VariableDeclarationHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-var + | | | +- VariableName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypeAnnotation + | | | | +- T-colon + | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- SType + | | | | +- T-question + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- T-dot + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- FunctionDeclaration + | | | +- FunctionHead + | | | | +- Attributes + | | | | | +- Attribute + | | | | | +- T-at-symbol + | | | | | +- AttributeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-func + | | | +- FunctionName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionSignature + | | | | +- ParameterClause + | | | | | +- T-lparen + | | | | | +- ParameterList + | | | | | | +- Parameter + | | | | | | +- LocalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- TypeAnnotation + | | | | | | +- T-colon + | | | | | | +- SType + | | | | | | +- TypeIdentifier + | | | | | | +- TypeName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- FunctionResult + | | | | +- T-rarrow + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- BinaryExpression + | | | | | | | +- BinaryOperator + | | | | | | | | +- Operator + | | | | | | | | +- OperatorHead + | | | | | | | | +- T-ge + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- LiteralExpression + | | | | | | | +- Literal + | | | | | | | +- NumericLiteral + | | | | | | | +- IntegerLiteral + | | | | | | | +- T-DecimalLiteral + | | | | | | +- BinaryExpression + | | | | | | | +- BinaryOperator + | | | | | | | | +- Operator + | | | | | | | | +- OperatorHead + | | | | | | | | +- T-133 + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- BinaryExpression + | | | | | | +- BinaryOperator + | | | | | | | +- Operator + | | | | | | | +- OperatorHead + | | | | | | | +- T-lt + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- Statement + | | | | | +- Declaration + | | | | | +- VariableDeclaration + | | | | | +- VariableDeclarationHead + | | | | | | +- T-var + | | | | | +- PatternInitializerList + | | | | | +- PatternInitializer + | | | | | +- Pattern + | | | | | | +- IdentifierPattern + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- Initializer + | | | | | +- T-eq + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- Statement + | | | | | +- Declaration + | | | | | +- VariableDeclaration + | | | | | +- VariableDeclarationHead + | | | | | | +- T-var + | | | | | +- PatternInitializerList + | | | | | +- PatternInitializer + | | | | | +- Pattern + | | | | | | +- IdentifierPattern + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- Initializer + | | | | | +- T-eq + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- Statement + | | | | | +- LoopStatement + | | | | | +- WhileStatement + | | | | | +- T-while + | | | | | +- ConditionList + | | | | | | +- Condition + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PrefixOperator + | | | | | | | +- Operator + | | | | | | | +- OperatorHead + | | | | | | | +- T-bang + | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- CodeBlock + | | | | | +- T-lbrace + | | | | | +- Statements + | | | | | | +- Statement + | | | | | | | +- Declaration + | | | | | | | +- ConstantDeclaration + | | | | | | | +- T-let + | | | | | | | +- PatternInitializerList + | | | | | | | +- PatternInitializer + | | | | | | | +- Pattern + | | | | | | | | +- IdentifierPattern + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- Initializer + | | | | | | | +- T-eq + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | +- FunctionCallArgumentClause + | | | | | | | +- T-lparen + | | | | | | | +- FunctionCallArgumentList + | | | | | | | | +- FunctionCallArgument + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-rparen + | | | | | | +- Statement + | | | | | | | +- BranchStatement + | | | | | | | +- IfStatement + | | | | | | | +- T-if + | | | | | | | +- ConditionList + | | | | | | | | +- Condition + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- CodeBlock + | | | | | | | +- T-lbrace + | | | | | | | +- Statements + | | | | | | | | +- Statement + | | | | | | | | +- ControlTransferStatement + | | | | | | | | +- ReturnStatement + | | | | | | | | +- T-return + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- T-dot + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | +- T-lbracket + | | | | | | | | +- TupleElementList + | | | | | | | | | +- TupleElement + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- T-dot + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- T-rbracket + | | | | | | | +- T-rbrace + | | | | | | +- Statement + | | | | | | | +- Declaration + | | | | | | | +- ConstantDeclaration + | | | | | | | +- T-let + | | | | | | | +- PatternInitializerList + | | | | | | | +- PatternInitializer + | | | | | | | +- Pattern + | | | | | | | | +- IdentifierPattern + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- Initializer + | | | | | | | +- T-eq + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | +- T-lbracket + | | | | | | | +- TupleElementList + | | | | | | | | +- TupleElement + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-rbracket + | | | | | | +- Statement + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | +- PostfixOperator + | | | | | | | +- Operator + | | | | | | | +- OperatorHead + | | | | | | | | +- T-minus + | | | | | | | +- OperatorCharacter + | | | | | | | +- OperatorHead + | | | | | | | +- T-eq + | | | | | | +- Statement + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | +- PostfixOperator + | | | | | | | +- Operator + | | | | | | | +- OperatorHead + | | | | | | | +- T-minus + | | | | | | +- Statement + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | +- T-dot + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- Statement + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | +- PostfixOperator + | | | | | | | +- Operator + | | | | | | | +- OperatorHead + | | | | | | | +- T-eq + | | | | | | +- Statement + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rbrace + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | | +- T-dot + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- T-lbracket + | | | | +- TupleElementList + | | | | | +- TupleElement + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rbracket + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- FunctionDeclaration + | | | +- FunctionHead + | | | | +- Attributes + | | | | | +- Attribute + | | | | | +- T-at-symbol + | | | | | +- AttributeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-func + | | | +- FunctionName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionSignature + | | | | +- ParameterClause + | | | | | +- T-lparen + | | | | | +- ParameterList + | | | | | | +- Parameter + | | | | | | | +- LocalParameterName + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- TypeAnnotation + | | | | | | | +- T-colon + | | | | | | | +- SType + | | | | | | | +- TypeIdentifier + | | | | | | | +- TypeName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- Parameter + | | | | | | +- ExternalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- LocalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- TypeAnnotation + | | | | | | | +- T-colon + | | | | | | | +- SType + | | | | | | | +- TypeIdentifier + | | | | | | | +- TypeName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- DefaultArgumentClause + | | | | | | +- T-eq + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Keyword + | | | | | | +- T-Any + | | | | | +- T-rparen + | | | | +- FunctionResult + | | | | +- T-rarrow + | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- SType + | | | | +- T-question + | | | +- FunctionBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- BranchStatement + | | | | +- SwitchStatement + | | | | +- T-switch + | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-lbrace + | | | | +- SwitchCases + | | | | | +- SwitchCase + | | | | | | +- CaseLabel + | | | | | | | +- T-case + | | | | | | | +- CaseItemList + | | | | | | | | +- CaseItem + | | | | | | | | +- Pattern + | | | | | | | | +- ExpressionPattern + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Keyword + | | | | | | | | +- T-Any + | | | | | | | +- T-colon + | | | | | | +- Statements + | | | | | | +- Statement + | | | | | | | +- Declaration + | | | | | | | +- VariableDeclaration + | | | | | | | +- VariableDeclarationHead + | | | | | | | | +- T-var + | | | | | | | +- PatternInitializerList + | | | | | | | +- PatternInitializer + | | | | | | | +- Pattern + | | | | | | | | +- IdentifierPattern + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- Initializer + | | | | | | | +- T-eq + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- Statement + | | | | | | | +- LoopStatement + | | | | | | | +- WhileStatement + | | | | | | | +- T-while + | | | | | | | +- ConditionList + | | | | | | | | +- Condition + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Keyword + | | | | | | | | +- T-BooleanLiteral + | | | | | | | +- CodeBlock + | | | | | | | +- T-lbrace + | | | | | | | +- Statements + | | | | | | | | +- Statement + | | | | | | | | | +- Declaration + | | | | | | | | | +- ConstantDeclaration + | | | | | | | | | +- T-let + | | | | | | | | | +- PatternInitializerList + | | | | | | | | | +- PatternInitializer + | | | | | | | | | +- Pattern + | | | | | | | | | | +- IdentifierPattern + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- Initializer + | | | | | | | | | +- T-eq + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- T-dot + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- FunctionCallArgumentClause + | | | | | | | | | +- T-lparen + | | | | | | | | | +- FunctionCallArgumentList + | | | | | | | | | | +- FunctionCallArgument + | | | | | | | | | | | +- Expression + | | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- T-comma + | | | | | | | | | | +- FunctionCallArgument + | | | | | | | | | | +- FunctionCallIdentifier + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- T-colon + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- ImplicitMemberExpression + | | | | | | | | | | +- T-dot + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- T-rparen + | | | | | | | | +- Statement + | | | | | | | | | +- BranchStatement + | | | | | | | | | +- IfStatement + | | | | | | | | | +- T-if + | | | | | | | | | +- ConditionList + | | | | | | | | | | +- Condition + | | | | | | | | | | +- OptionalBindingCondition + | | | | | | | | | | +- T-let + | | | | | | | | | | +- Pattern + | | | | | | | | | | | +- IdentifierPattern + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- Initializer + | | | | | | | | | | +- T-eq + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- T-dot + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- CodeBlock + | | | | | | | | | +- T-lbrace + | | | | | | | | | +- Statements + | | | | | | | | | | +- Statement + | | | | | | | | | | +- ControlTransferStatement + | | | | | | | | | | +- ReturnStatement + | | | | | | | | | | +- T-return + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- T-dot + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- T-lbracket + | | | | | | | | | | | +- TupleElementList + | | | | | | | | | | | | +- TupleElement + | | | | | | | | | | | | +- Expression + | | | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | | +- Identifier + | | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | | +- T-rbracket + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- T-dot + | | | | | | | | | | +- T-DecimalLiteral + | | | | | | | | | +- T-rbrace + | | | | | | | | +- Statement + | | | | | | | | | +- BranchStatement + | | | | | | | | | +- IfStatement + | | | | | | | | | +- T-if + | | | | | | | | | +- ConditionList + | | | | | | | | | | +- Condition + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- T-dot + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- CodeBlock + | | | | | | | | | +- T-lbrace + | | | | | | | | | +- Statements + | | | | | | | | | | +- Statement + | | | | | | | | | | +- ControlTransferStatement + | | | | | | | | | | +- BreakStatement + | | | | | | | | | | +- T-break + | | | | | | | | | +- T-rbrace + | | | | | | | | +- Statement + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PostfixOperator + | | | | | | | | | +- Operator + | | | | | | | | | +- OperatorHead + | | | | | | | | | +- T-eq + | | | | | | | | +- Statement + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- T-dot + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | +- T-lbracket + | | | | | | | | +- TupleElementList + | | | | | | | | | +- TupleElement + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- T-dot + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- T-rbracket + | | | | | | | +- T-rbrace + | | | | | | +- Statement + | | | | | | +- ControlTransferStatement + | | | | | | +- ReturnStatement + | | | | | | +- T-return + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Keyword + | | | | | | +- T-NilLiteral + | | | | | +- SwitchCase + | | | | | +- DefaultLabel + | | | | | | +- T-default + | | | | | | +- T-colon + | | | | | +- Statements + | | | | | +- Statement + | | | | | | +- Declaration + | | | | | | +- VariableDeclaration + | | | | | | +- VariableDeclarationHead + | | | | | | | +- T-var + | | | | | | +- PatternInitializerList + | | | | | | +- PatternInitializer + | | | | | | +- Pattern + | | | | | | | +- IdentifierPattern + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- Initializer + | | | | | | +- T-eq + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- Statement + | | | | | | +- Declaration + | | | | | | +- VariableDeclaration + | | | | | | +- VariableDeclarationHead + | | | | | | | +- T-var + | | | | | | +- PatternInitializerList + | | | | | | +- PatternInitializer + | | | | | | +- Pattern + | | | | | | | +- IdentifierPattern + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- TypeAnnotation + | | | | | | | +- T-colon + | | | | | | | +- SType + | | | | | | | | +- TypeIdentifier + | | | | | | | | +- TypeName + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- SType + | | | | | | | +- T-question + | | | | | | +- Initializer + | | | | | | +- T-eq + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Keyword + | | | | | | +- T-NilLiteral + | | | | | +- Statement + | | | | | | +- LoopStatement + | | | | | | +- WhileStatement + | | | | | | +- T-while + | | | | | | +- ConditionList + | | | | | | | +- Condition + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Keyword + | | | | | | | +- T-BooleanLiteral + | | | | | | +- CodeBlock + | | | | | | +- T-lbrace + | | | | | | +- Statements + | | | | | | | +- Statement + | | | | | | | | +- Declaration + | | | | | | | | +- ConstantDeclaration + | | | | | | | | +- T-let + | | | | | | | | +- PatternInitializerList + | | | | | | | | +- PatternInitializer + | | | | | | | | +- Pattern + | | | | | | | | | +- IdentifierPattern + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- Initializer + | | | | | | | | +- T-eq + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- T-dot + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | +- FunctionCallArgumentClause + | | | | | | | | +- T-lparen + | | | | | | | | +- FunctionCallArgumentList + | | | | | | | | | +- FunctionCallArgument + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- T-comma + | | | | | | | | | +- FunctionCallArgument + | | | | | | | | | +- FunctionCallIdentifier + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- T-colon + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- T-rparen + | | | | | | | +- Statement + | | | | | | | | +- BranchStatement + | | | | | | | | +- IfStatement + | | | | | | | | +- T-if + | | | | | | | | +- ConditionList + | | | | | | | | | +- Condition + | | | | | | | | | +- OptionalBindingCondition + | | | | | | | | | +- T-let + | | | | | | | | | +- Pattern + | | | | | | | | | | +- IdentifierPattern + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- Initializer + | | | | | | | | | +- T-eq + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- T-dot + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- CodeBlock + | | | | | | | | +- T-lbrace + | | | | | | | | +- Statements + | | | | | | | | | +- Statement + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PostfixOperator + | | | | | | | | | | +- Operator + | | | | | | | | | | +- OperatorHead + | | | | | | | | | | +- T-eq + | | | | | | | | | +- Statement + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- T-dot + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- T-lbracket + | | | | | | | | | | +- TupleElementList + | | | | | | | | | | | +- TupleElement + | | | | | | | | | | | +- Expression + | | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- T-rbracket + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- T-dot + | | | | | | | | | +- T-DecimalLiteral + | | | | | | | | +- T-rbrace + | | | | | | | +- Statement + | | | | | | | | +- BranchStatement + | | | | | | | | +- IfStatement + | | | | | | | | +- T-if + | | | | | | | | +- ConditionList + | | | | | | | | | +- Condition + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- T-dot + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- CodeBlock + | | | | | | | | +- T-lbrace + | | | | | | | | +- Statements + | | | | | | | | | +- Statement + | | | | | | | | | +- ControlTransferStatement + | | | | | | | | | +- BreakStatement + | | | | | | | | | +- T-break + | | | | | | | | +- T-rbrace + | | | | | | | +- Statement + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | +- PostfixOperator + | | | | | | | | +- Operator + | | | | | | | | +- OperatorHead + | | | | | | | | +- T-eq + | | | | | | | +- Statement + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | +- T-lbracket + | | | | | | | +- TupleElementList + | | | | | | | | +- TupleElement + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-rbracket + | | | | | | +- T-rbrace + | | | | | +- Statement + | | | | | +- ControlTransferStatement + | | | | | +- ReturnStatement + | | | | | +- T-return + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rbrace + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- FunctionDeclaration + | | | +- FunctionHead + | | | | +- Attributes + | | | | | +- Attribute + | | | | | +- T-at-symbol + | | | | | +- AttributeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-func + | | | +- FunctionName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionSignature + | | | | +- ParameterClause + | | | | | +- T-lparen + | | | | | +- ParameterList + | | | | | | +- Parameter + | | | | | | | +- LocalParameterName + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- TypeAnnotation + | | | | | | | +- T-colon + | | | | | | | +- SType + | | | | | | | +- TypeIdentifier + | | | | | | | +- TypeName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- Parameter + | | | | | | +- ExternalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- LocalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- TypeAnnotation + | | | | | | | +- T-colon + | | | | | | | +- SType + | | | | | | | +- TypeIdentifier + | | | | | | | +- TypeName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- DefaultArgumentClause + | | | | | | +- T-eq + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Keyword + | | | | | | +- T-Any + | | | | | +- T-rparen + | | | | +- FunctionResult + | | | | +- T-rarrow + | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- SType + | | | | +- T-question + | | | +- FunctionBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | | +- Declaration + | | | | | +- ConstantDeclaration + | | | | | +- T-let + | | | | | +- PatternInitializerList + | | | | | +- PatternInitializer + | | | | | +- Pattern + | | | | | | +- IdentifierPattern + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- Initializer + | | | | | +- T-eq + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | | +- FunctionCallIdentifier + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-colon + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- FunctionCallArgument + | | | | | | | +- FunctionCallIdentifier + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-colon + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- FunctionCallArgument + | | | | | | +- FunctionCallIdentifier + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-colon + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- Statement + | | | | | +- BranchStatement + | | | | | +- GuardStatement + | | | | | +- T-guard + | | | | | +- ConditionList + | | | | | | +- Condition + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PrefixOperator + | | | | | | | +- Operator + | | | | | | | +- OperatorHead + | | | | | | | +- T-bang + | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- PostfixExpression + | | | | | | | +- T-dot + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- PostfixExpression + | | | | | | | +- PostfixOperator + | | | | | | | +- Operator + | | | | | | | +- OperatorHead + | | | | | | | +- T-133 + | | | | | | +- PostfixExpression + | | | | | | +- FunctionCallArgumentClause + | | | | | | +- T-lparen + | | | | | | +- FunctionCallArgumentList + | | | | | | | +- FunctionCallArgument + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PostfixOperator + | | | | | | | | | +- Operator + | | | | | | | | | +- OperatorHead + | | | | | | | | | +- T-double-eq + | | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- BinaryExpression + | | | | | | | | +- BinaryOperator + | | | | | | | | | +- Operator + | | | | | | | | | +- OperatorHead + | | | | | | | | | +- T-134 + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- BinaryExpression + | | | | | | | +- BinaryOperator + | | | | | | | | +- Operator + | | | | | | | | +- OperatorHead + | | | | | | | | +- T-double-eq + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-rparen + | | | | | +- T-else + | | | | | +- CodeBlock + | | | | | +- T-lbrace + | | | | | +- Statements + | | | | | | +- Statement + | | | | | | +- ControlTransferStatement + | | | | | | +- ReturnStatement + | | | | | | +- T-return + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Keyword + | | | | | | +- T-NilLiteral + | | | | | +- T-rbrace + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- FunctionDeclaration + | | | +- FunctionHead + | | | | +- Attributes + | | | | | +- Attribute + | | | | | +- T-at-symbol + | | | | | +- AttributeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-func + | | | +- FunctionName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionSignature + | | | | +- ParameterClause + | | | | | +- T-lparen + | | | | | +- ParameterList + | | | | | | +- Parameter + | | | | | | | +- LocalParameterName + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- TypeAnnotation + | | | | | | | +- T-colon + | | | | | | | +- SType + | | | | | | | +- TypeIdentifier + | | | | | | | +- TypeName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- Parameter + | | | | | | +- ExternalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- LocalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- TypeAnnotation + | | | | | | | +- T-colon + | | | | | | | +- SType + | | | | | | | +- TypeIdentifier + | | | | | | | +- TypeName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- DefaultArgumentClause + | | | | | | +- T-eq + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Keyword + | | | | | | +- T-Any + | | | | | +- T-rparen + | | | | +- FunctionResult + | | | | +- T-rarrow + | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- SType + | | | | +- T-question + | | | +- FunctionBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | | +- Declaration + | | | | | +- VariableDeclaration + | | | | | +- VariableDeclarationHead + | | | | | | +- T-var + | | | | | +- PatternInitializerList + | | | | | +- PatternInitializer + | | | | | +- Pattern + | | | | | | +- IdentifierPattern + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- Initializer + | | | | | +- T-eq + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- Statement + | | | | | +- Declaration + | | | | | +- VariableDeclaration + | | | | | +- VariableDeclarationHead + | | | | | | +- T-var + | | | | | +- PatternInitializerList + | | | | | +- PatternInitializer + | | | | | +- Pattern + | | | | | | +- IdentifierPattern + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- Initializer + | | | | | +- T-eq + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- LiteralExpression + | | | | | +- Literal + | | | | | +- NumericLiteral + | | | | | +- IntegerLiteral + | | | | | +- T-DecimalLiteral + | | | | +- Statement + | | | | | +- Declaration + | | | | | +- VariableDeclaration + | | | | | +- VariableDeclarationHead + | | | | | | +- T-var + | | | | | +- PatternInitializerList + | | | | | +- PatternInitializer + | | | | | +- Pattern + | | | | | | +- IdentifierPattern + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- TypeAnnotation + | | | | | | +- T-colon + | | | | | | +- SType + | | | | | | | +- TypeIdentifier + | | | | | | | +- TypeName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- SType + | | | | | | +- T-question + | | | | | +- Initializer + | | | | | +- T-eq + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Keyword + | | | | | +- T-NilLiteral + | | | | +- Statement + | | | | | +- LoopStatement + | | | | | +- WhileStatement + | | | | | +- T-while + | | | | | +- ConditionList + | | | | | | +- Condition + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PrefixOperator + | | | | | | | +- Operator + | | | | | | | +- OperatorHead + | | | | | | | +- T-bang + | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- CodeBlock + | | | | | +- T-lbrace + | | | | | +- Statements + | | | | | | +- Statement + | | | | | | | +- Declaration + | | | | | | | +- ConstantDeclaration + | | | | | | | +- T-let + | | | | | | | +- PatternInitializerList + | | | | | | | +- PatternInitializer + | | | | | | | +- Pattern + | | | | | | | | +- IdentifierPattern + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- Initializer + | | | | | | | +- T-eq + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | +- FunctionCallArgumentClause + | | | | | | | +- T-lparen + | | | | | | | +- FunctionCallArgumentList + | | | | | | | | +- FunctionCallArgument + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- T-comma + | | | | | | | | +- FunctionCallArgument + | | | | | | | | +- FunctionCallIdentifier + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- T-colon + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-rparen + | | | | | | +- Statement + | | | | | | | +- Declaration + | | | | | | | +- ConstantDeclaration + | | | | | | | +- T-let + | | | | | | | +- PatternInitializerList + | | | | | | | +- PatternInitializer + | | | | | | | +- Pattern + | | | | | | | | +- IdentifierPattern + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- Initializer + | | | | | | | +- T-eq + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | +- T-lbracket + | | | | | | | +- TupleElementList + | | | | | | | | +- TupleElement + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-rbracket + | | | | | | +- Statement + | | | | | | | +- BranchStatement + | | | | | | | +- IfStatement + | | | | | | | +- T-if + | | | | | | | +- ConditionList + | | | | | | | | +- Condition + | | | | | | | | +- OptionalBindingCondition + | | | | | | | | +- T-let + | | | | | | | | +- Pattern + | | | | | | | | | +- IdentifierPattern + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- Initializer + | | | | | | | | +- T-eq + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- CodeBlock + | | | | | | | | +- T-lbrace + | | | | | | | | +- Statements + | | | | | | | | | +- Statement + | | | | | | | | | | +- Declaration + | | | | | | | | | | +- ConstantDeclaration + | | | | | | | | | | +- T-let + | | | | | | | | | | +- PatternInitializerList + | | | | | | | | | | +- PatternInitializer + | | | | | | | | | | +- Pattern + | | | | | | | | | | | +- IdentifierPattern + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- Initializer + | | | | | | | | | | +- T-eq + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- T-dot + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- FunctionCallArgumentClause + | | | | | | | | | | +- T-lparen + | | | | | | | | | | +- FunctionCallArgumentList + | | | | | | | | | | | +- FunctionCallArgument + | | | | | | | | | | | +- Expression + | | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- T-rparen + | | | | | | | | | +- Statement + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PostfixOperator + | | | | | | | | | | +- Operator + | | | | | | | | | | +- OperatorHead + | | | | | | | | | | +- T-eq + | | | | | | | | | +- Statement + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PostfixOperator + | | | | | | | | | | +- Operator + | | | | | | | | | | +- OperatorHead + | | | | | | | | | | +- T-OperatorHead + | | | | | | | | | +- Statement + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- Statement + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PostfixOperator + | | | | | | | | | | +- Operator + | | | | | | | | | | +- OperatorHead + | | | | | | | | | | | +- T-OperatorHead + | | | | | | | | | | +- OperatorCharacter + | | | | | | | | | | +- OperatorHead + | | | | | | | | | | +- T-eq + | | | | | | | | | +- Statement + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PostfixOperator + | | | | | | | | | | +- Operator + | | | | | | | | | | +- OperatorHead + | | | | | | | | | | +- T-minus + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- FunctionCallArgumentClause + | | | | | | | | | +- T-lparen + | | | | | | | | | +- FunctionCallArgumentList + | | | | | | | | | | +- FunctionCallArgument + | | | | | | | | | | +- Expression + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- BinaryExpression + | | | | | | | | | | | +- BinaryOperator + | | | | | | | | | | | | +- Operator + | | | | | | | | | | | | +- OperatorHead + | | | | | | | | | | | | +- T-double-eq + | | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | | +- Identifier + | | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- T-dot + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- BinaryExpression + | | | | | | | | | | +- ConditionalOperator + | | | | | | | | | | | +- T-question + | | | | | | | | | | | +- Expression + | | | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | | | +- Identifier + | | | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | | | +- T-dot + | | | | | | | | | | | | | +- Identifier + | | | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | | | +- T-lbracket + | | | | | | | | | | | | | +- TupleElementList + | | | | | | | | | | | | | | +- TupleElement + | | | | | | | | | | | | | | +- Expression + | | | | | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | | | | +- Identifier + | | | | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | | | | +- T-rbracket + | | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | | +- T-dot + | | | | | | | | | | | | +- Identifier + | | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | | +- T-colon + | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- LiteralExpression + | | | | | | | | | | +- Literal + | | | | | | | | | | +- NumericLiteral + | | | | | | | | | | +- IntegerLiteral + | | | | | | | | | | +- T-DecimalLiteral + | | | | | | | | | +- T-rparen + | | | | | | | | +- T-rbrace + | | | | | | | +- ElseClause + | | | | | | | +- T-else + | | | | | | | +- CodeBlock + | | | | | | | +- T-lbrace + | | | | | | | +- Statements + | | | | | | | | +- Statement + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PostfixOperator + | | | | | | | | | +- Operator + | | | | | | | | | +- OperatorHead + | | | | | | | | | | +- T-OperatorHead + | | | | | | | | | +- OperatorCharacter + | | | | | | | | | +- OperatorHead + | | | | | | | | | +- T-eq + | | | | | | | | +- Statement + | | | | | | | | | +- Expression + | | | | | | | | | +- PrefixExpression + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- T-dot + | | | | | | | | | | +- Identifier + | | | | | | | | | | +- T-Identifier + | | | | | | | | | +- PostfixExpression + | | | | | | | | | | +- FunctionCallArgumentClause + | | | | | | | | | | +- T-lparen + | | | | | | | | | | +- FunctionCallArgumentList + | | | | | | | | | | | +- FunctionCallArgument + | | | | | | | | | | | +- Expression + | | | | | | | | | | | +- PrefixExpression + | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | | +- PrimaryExpression + | | | | | | | | | | | | +- Identifier + | | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | | +- PostfixExpression + | | | | | | | | | | | +- T-dot + | | | | | | | | | | | +- Identifier + | | | | | | | | | | | +- T-Identifier + | | | | | | | | | | +- T-rparen + | | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PostfixOperator + | | | | | | | | | +- Operator + | | | | | | | | | +- OperatorHead + | | | | | | | | | +- T-minus + | | | | | | | | +- Statement + | | | | | | | | +- Expression + | | | | | | | | +- PrefixExpression + | | | | | | | | +- PostfixExpression + | | | | | | | | | +- PrimaryExpression + | | | | | | | | | +- Identifier + | | | | | | | | | +- T-Identifier + | | | | | | | | +- PostfixExpression + | | | | | | | | +- T-dot + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- T-rbrace + | | | | | | +- Statement + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | +- PostfixOperator + | | | | | | | +- Operator + | | | | | | | +- OperatorHead + | | | | | | | +- T-eq + | | | | | | +- Statement + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rbrace + | | | | +- Statement + | | | | | +- Declaration + | | | | | +- ConstantDeclaration + | | | | | +- T-let + | | | | | +- PatternInitializerList + | | | | | +- PatternInitializer + | | | | | +- Pattern + | | | | | | +- IdentifierPattern + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- Initializer + | | | | | +- T-eq + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-comma + | | | | | | +- FunctionCallArgument + | | | | | | +- FunctionCallIdentifier + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-colon + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- Statement + | | | | | +- BranchStatement + | | | | | +- IfStatement + | | | | | +- T-if + | | | | | +- ConditionList + | | | | | | +- Condition + | | | | | | +- OptionalBindingCondition + | | | | | | +- T-let + | | | | | | +- Pattern + | | | | | | | +- IdentifierPattern + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- Initializer + | | | | | | +- T-eq + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | | +- PrimaryExpression + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- CodeBlock + | | | | | +- T-lbrace + | | | | | +- Statements + | | | | | | +- Statement + | | | | | | | +- ControlTransferStatement + | | | | | | | +- ReturnStatement + | | | | | | | +- T-return + | | | | | | | +- Expression + | | | | | | | +- PrefixExpression + | | | | | | | +- PostfixExpression + | | | | | | | | +- PrimaryExpression + | | | | | | | | +- Identifier + | | | | | | | | +- T-Identifier + | | | | | | | +- PostfixExpression + | | | | | | | +- PostfixOperator + | | | | | | | +- Operator + | | | | | | | +- OperatorHead + | | | | | | | +- T-OperatorHead + | | | | | | +- Statement + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rbrace + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | +- PrimaryExpression + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rbrace + | | +- ExtensionMember + | | | +- Declaration + | | | +- FunctionDeclaration + | | | +- FunctionHead + | | | | +- Attributes + | | | | | +- Attribute + | | | | | +- T-at-symbol + | | | | | +- AttributeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-func + | | | +- FunctionName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionSignature + | | | | +- ParameterClause + | | | | | +- T-lparen + | | | | | +- ParameterList + | | | | | | +- Parameter + | | | | | | +- LocalParameterName + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- TypeAnnotation + | | | | | | +- T-colon + | | | | | | +- SType + | | | | | | +- TypeIdentifier + | | | | | | +- TypeName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- FunctionResult + | | | | +- T-rarrow + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- FunctionBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- FunctionCallArgumentClause + | | | | | +- T-lparen + | | | | | +- FunctionCallArgumentList + | | | | | | +- FunctionCallArgument + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-rparen + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | | +- T-dot + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- T-dot + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rbrace + | | +- ExtensionMember + | | +- Declaration + | | +- FunctionDeclaration + | | +- FunctionHead + | | | +- Attributes + | | | | +- Attribute + | | | | +- T-at-symbol + | | | | +- AttributeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- DeclarationModifiers + | | | | +- DeclarationModifier + | | | | +- AccessLevelModifier + | | | | +- T-public + | | | +- T-func + | | +- FunctionName + | | | +- Identifier + | | | +- T-Identifier + | | +- FunctionSignature + | | | +- ParameterClause + | | | | +- T-lparen + | | | | +- ParameterList + | | | | | +- Parameter + | | | | | +- LocalParameterName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- TypeAnnotation + | | | | | +- T-colon + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- FunctionResult + | | | +- T-rarrow + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | +- Identifier + | | | +- T-Identifier + | | +- FunctionBody + | | +- CodeBlock + | | +- T-lbrace + | | +- Statements + | | | +- Statement + | | | +- ControlTransferStatement + | | | +- ReturnStatement + | | | +- T-return + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | | +- PrimaryExpression + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- PostfixExpression + | | | +- FunctionCallArgumentClause + | | | +- T-lparen + | | | +- FunctionCallArgumentList + | | | | +- FunctionCallArgument + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | | +- FunctionCallIdentifier + | | | | | | | +- Identifier + | | | | | | | +- T-Identifier + | | | | | | +- T-colon + | | | | | | +- Expression + | | | | | | +- PrefixExpression + | | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-comma + | | | | | +- FunctionCallArgument + | | | | | +- FunctionCallIdentifier + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-colon + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- T-rparen + | | +- T-rbrace + | +- T-rbrace + +- Statement + | +- Expression + | +- PrefixExpression + | +- PostfixExpression + | +- PrimaryExpression + | +- Keyword + | +- T-extension + +- Statement + | +- Expression + | +- PrefixExpression + | +- PostfixExpression + | +- PrimaryExpression + | +- Identifier + | +- T-Identifier + +- Statement + | +- Expression + | +- PrefixExpression + | +- PostfixExpression + | +- PrimaryExpression + | +- ClosureExpression + | +- T-lbrace + | +- Statements + | +- Statement + | | +- Expression + | | +- PrefixExpression + | | +- PostfixExpression + | | +- PrimaryExpression + | | +- Keyword + | | +- T-internal + | +- Statement + | | +- Expression + | | +- PrefixExpression + | | +- PostfixExpression + | | +- PrimaryExpression + | | +- Identifier + | | +- ContextSensitiveKeyword + | | +- T-mutating + | +- Statement + | | +- Declaration + | | +- FunctionDeclaration + | +- Statement + | | +- Declaration + | | +- FunctionDeclaration + | +- Statement + | | +- Expression + | | +- PrefixExpression + | | +- PostfixExpression + | | +- PrimaryExpression + | | +- Identifier + | | +- T-Identifier + | +- Statement + | | +- Expression + | | +- PrefixExpression + | | +- PostfixExpression + | | +- PrimaryExpression + | +- Statement + | | +- Expression + | | +- PrefixExpression + | | +- PostfixExpression + | | +- PrimaryExpression + | +- Statement + | | +- Declaration + | +- Statement + | | +- Declaration + | +- Statement + | | +- Expression + | | +- PrefixExpression + | | +- PostfixExpression + | | +- PrimaryExpression + | | +- Identifier + | | +- T-Identifier + | +- Statement + | | +- Expression + | | +- PrefixExpression + | | +- PostfixExpression + | | +- PrimaryExpression + | | +- Identifier + | | +- T-Identifier + | +- Statement + | | +- LabeledStatement + | | +- StatementLabel + | | +- LabelName + | | | +- Identifier + | | | +- T-Identifier + | | +- T-colon + | +- Statement + | | +- Expression + | | +- PrefixExpression + | | +- PostfixExpression + | | +- PrimaryExpression + | | +- Identifier + | | +- T-Identifier + | +- Statement + | | +- Expression + | | +- PrefixExpression + | | +- PrefixOperator + | | | +- Operator + | | | +- OperatorHead + | | | +- T-rarrow + | | +- PostfixExpression + | | +- PrimaryExpression + | | +- Identifier + | | +- T-Identifier + | +- Statement + | +- Expression + | +- PrefixExpression + | +- PostfixExpression + | +- PrimaryExpression + | +- Operator + | +- OperatorHead + | +- T-question + +- Statement + | +- Declaration + +- Statement + | +- Declaration + +- Statement + | +- Expression + | +- PrefixExpression + | +- PostfixExpression + | +- PrimaryExpression + | +- Identifier + | +- T-Identifier + +- Statement + | +- LabeledStatement + | +- StatementLabel + | +- LabelName + | | +- Identifier + | | +- T-Identifier + | +- T-colon + +- Statement + | +- Expression + | +- PrefixExpression + | +- PostfixExpression + | +- PrimaryExpression + | +- TupleExpression + | +- T-lparen + | +- TupleElementList + | | +- TupleElement + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | +- PrimaryExpression + | | | +- Identifier + | | | +- T-Identifier + | | +- T-comma + | | +- TupleElement + | | +- Expression + | | +- PrefixExpression + | | +- PostfixExpression + | | +- PrimaryExpression + | | +- Identifier + | | +- T-Identifier + | +- T-rparen + +- Statement + | +- Expression + | +- PrefixExpression + +- Statement + +- Expression + +- PrefixExpression + +- PostfixExpression + +- PrimaryExpression + +- Identifier + +- T-Identifier diff --git a/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/ast/testdata/Simple.txt b/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/ast/testdata/Simple.txt index 4fcafc9c9b..029463f5bd 100644 --- a/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/ast/testdata/Simple.txt +++ b/pmd-swift/src/test/resources/net/sourceforge/pmd/lang/swift/ast/testdata/Simple.txt @@ -1,232 +1,329 @@ +- TopLevel +- Statements - +- Statement - +- Declaration - +- StructDeclaration - +- AccessLevelModifier - +- StructName - | +- Identifier - +- GenericParameterClause - | +- GenericParameterList - | +- GenericParameter - | | +- TypeName - | | | +- Identifier - | | +- TypeIdentifier - | | +- TypeName - | | +- Identifier - | +- GenericParameter - | +- TypeName - | +- Identifier - +- StructBody - +- StructMembers - +- StructMember - | +- Declaration - | +- TypealiasDeclaration - | +- TypealiasHead - | | +- AccessLevelModifier - | | +- TypealiasName - | | +- Identifier - | +- TypealiasAssignment - | +- SType - | +- TupleType - | +- TupleTypeElementList - | +- TupleTypeElement - | | +- SType - | | +- TypeIdentifier - | | +- TypeName - | | +- Identifier - | +- TupleTypeElement - | +- SType - | +- TypeIdentifier - | +- TypeName - | +- Identifier - +- StructMember - | +- Declaration - | +- TypealiasDeclaration - | +- TypealiasHead - | | +- AccessLevelModifier - | | +- TypealiasName - | | +- Identifier - | +- TypealiasAssignment - | +- SType - | +- TypeIdentifier - | +- TypeName - | | +- Identifier - | +- GenericArgumentClause - | +- GenericArgumentList - | +- GenericArgument - | | +- SType - | | +- TypeIdentifier - | | +- TypeName - | | +- Identifier - | +- GenericArgument - | +- SType - | +- TypeIdentifier - | +- TypeName - | +- Identifier - +- StructMember - | +- Declaration - | +- VariableDeclaration - | +- VariableDeclarationHead - | | +- DeclarationModifiers - | | +- DeclarationModifier - | | +- AccessLevelModifier - | +- PatternInitializerList - | +- PatternInitializer - | +- Pattern - | +- IdentifierPattern - | | +- Identifier - | +- TypeAnnotation - | +- SType - | +- TypeIdentifier - | +- TypeName - | +- Identifier - +- StructMember - | +- Declaration - | +- InitializerDeclaration - | +- InitializerHead - | | +- DeclarationModifiers - | | +- DeclarationModifier - | | +- AccessLevelModifier - | +- ParameterClause - | | +- ParameterList - | | +- Parameter - | | +- ExternalParameterName - | | | +- Keyword - | | +- LocalParameterName - | | | +- Identifier - | | +- TypeAnnotation - | | +- SType - | | +- TypeIdentifier - | | +- TypeName - | | +- Identifier - | +- InitializerBody - | +- CodeBlock - | +- Statements - | +- Statement - | | +- Expression - | | +- PrefixExpression - | | +- PostfixExpression - | | | +- PrimaryExpression - | | | +- Keyword - | | +- PostfixExpression - | | | +- Identifier - | | +- PostfixExpression - | | +- PostfixOperator - | | +- Operator - | | +- OperatorHead - | +- Statement - | +- Expression - | +- PrefixExpression - | +- PostfixExpression - | +- PrimaryExpression - | +- Identifier - +- StructMember - | +- Declaration - | +- InitializerDeclaration - | +- InitializerHead - | | +- DeclarationModifiers - | | +- DeclarationModifier - | | +- AccessLevelModifier - | +- ParameterClause - | | +- ParameterList - | | +- Parameter - | | +- LocalParameterName - | | | +- Identifier - | | +- TypeAnnotation - | | | +- SType - | | | +- TypeIdentifier - | | | +- TypeName - | | | +- Identifier - | | +- DefaultArgumentClause - | | +- Expression - | | +- PrefixExpression - | | +- PostfixExpression - | | | +- PrimaryExpression - | | | +- Identifier - | | +- PostfixExpression - | | +- Identifier - | +- InitializerBody - | +- CodeBlock - | +- Statements - | +- Statement - | | +- Expression - | | +- PrefixExpression - | | +- PostfixExpression - | | | +- PrimaryExpression - | | | +- Keyword - | | +- PostfixExpression - | | | +- Identifier - | | +- PostfixExpression - | | +- PostfixOperator - | | +- Operator - | | +- OperatorHead - | +- Statement - | +- Expression - | +- PrefixExpression - | +- PostfixExpression - | | +- PrimaryExpression - | | +- Identifier - | +- PostfixExpression - | +- FunctionCallArgumentClause - | +- FunctionCallArgumentList - | +- FunctionCallArgument - | +- FunctionCallIdentifier - | | +- Identifier - | +- Expression - | +- PrefixExpression - | +- PostfixExpression - | +- PrimaryExpression - | +- Identifier - +- StructMember - | +- Declaration - | +- VariableDeclaration - | +- VariableDeclarationHead - | | +- DeclarationModifiers - | | +- DeclarationModifier - | | +- AccessLevelModifier - | +- VariableName - | | +- Identifier - | +- TypeAnnotation - | | +- SType - | | +- TypeIdentifier - | | +- TypeName - | | +- Identifier - | +- CodeBlock - | +- Statements - | +- Statement - | +- ControlTransferStatement - | +- ReturnStatement - | +- Expression - | +- PrefixExpression - | +- PostfixExpression - | | +- PrimaryExpression - | | +- Identifier - | +- PostfixExpression - | +- Identifier - +- StructMember - +- Declaration - +- VariableDeclaration - +- VariableDeclarationHead - | +- DeclarationModifiers - | +- DeclarationModifier - | +- AccessLevelModifier - +- VariableName - | +- Identifier - +- TypeAnnotation - | +- SType - | +- TypeIdentifier - | +- TypeName - | +- Identifier - +- CodeBlock - +- Statements - +- Statement - +- ControlTransferStatement - +- ReturnStatement - +- Expression - +- PrefixExpression - +- PostfixExpression - | +- PrimaryExpression - | +- Identifier - +- PostfixExpression - +- Identifier + | +- Statement + | +- Declaration + | +- StructDeclaration + | +- AccessLevelModifier + | | +- T-public + | +- T-struct + | +- StructName + | | +- Identifier + | | +- T-Identifier + | +- GenericParameterClause + | | +- T-lt + | | +- GenericParameterList + | | | +- GenericParameter + | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-colon + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-comma + | | | +- GenericParameter + | | | +- TypeName + | | | +- Identifier + | | | +- T-Identifier + | | +- T-gt + | +- StructBody + | +- T-lbrace + | +- StructMembers + | | +- StructMember + | | | +- Declaration + | | | +- TypealiasDeclaration + | | | +- TypealiasHead + | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-typealias + | | | | +- TypealiasName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypealiasAssignment + | | | +- T-eq + | | | +- SType + | | | +- TupleType + | | | +- T-lparen + | | | +- TupleTypeElementList + | | | | +- TupleTypeElement + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-comma + | | | | +- TupleTypeElement + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rparen + | | +- StructMember + | | | +- Declaration + | | | +- TypealiasDeclaration + | | | +- TypealiasHead + | | | | +- AccessLevelModifier + | | | | | +- T-internal + | | | | +- T-typealias + | | | | +- TypealiasName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypealiasAssignment + | | | +- T-eq + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- GenericArgumentClause + | | | +- T-lt + | | | +- GenericArgumentList + | | | | +- GenericArgument + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-comma + | | | | +- GenericArgument + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-gt + | | +- StructMember + | | | +- Declaration + | | | +- VariableDeclaration + | | | +- VariableDeclarationHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-internal + | | | | +- T-var + | | | +- PatternInitializerList + | | | +- PatternInitializer + | | | +- Pattern + | | | +- IdentifierPattern + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypeAnnotation + | | | +- T-colon + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | +- Identifier + | | | +- T-Identifier + | | +- StructMember + | | | +- Declaration + | | | +- InitializerDeclaration + | | | +- InitializerHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-internal + | | | | +- T-init + | | | +- ParameterClause + | | | | +- T-lparen + | | | | +- ParameterList + | | | | | +- Parameter + | | | | | +- ExternalParameterName + | | | | | | +- Keyword + | | | | | | +- T-underscore + | | | | | +- LocalParameterName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- TypeAnnotation + | | | | | +- T-colon + | | | | | +- SType + | | | | | +- TypeIdentifier + | | | | | +- TypeName + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- InitializerBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Keyword + | | | | | | +- T-self + | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- PostfixOperator + | | | | | +- Operator + | | | | | +- OperatorHead + | | | | | +- T-eq + | | | | +- Statement + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | +- PrimaryExpression + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rbrace + | | +- StructMember + | | | +- Declaration + | | | +- InitializerDeclaration + | | | +- InitializerHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-init + | | | +- ParameterClause + | | | | +- T-lparen + | | | | +- ParameterList + | | | | | +- Parameter + | | | | | +- LocalParameterName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- TypeAnnotation + | | | | | | +- T-colon + | | | | | | +- SType + | | | | | | +- TypeIdentifier + | | | | | | +- TypeName + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- DefaultArgumentClause + | | | | | +- T-eq + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- T-dot + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- InitializerBody + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | | +- PrimaryExpression + | | | | | | +- Keyword + | | | | | | +- T-self + | | | | | +- PostfixExpression + | | | | | | +- T-dot + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- PostfixExpression + | | | | | +- PostfixOperator + | | | | | +- Operator + | | | | | +- OperatorHead + | | | | | +- T-eq + | | | | +- Statement + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- FunctionCallArgumentClause + | | | | +- T-lparen + | | | | +- FunctionCallArgumentList + | | | | | +- FunctionCallArgument + | | | | | +- FunctionCallIdentifier + | | | | | | +- Identifier + | | | | | | +- T-Identifier + | | | | | +- T-colon + | | | | | +- Expression + | | | | | +- PrefixExpression + | | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- T-rparen + | | | +- T-rbrace + | | +- StructMember + | | | +- Declaration + | | | +- VariableDeclaration + | | | +- VariableDeclarationHead + | | | | +- DeclarationModifiers + | | | | | +- DeclarationModifier + | | | | | +- AccessLevelModifier + | | | | | +- T-public + | | | | +- T-var + | | | +- VariableName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- TypeAnnotation + | | | | +- T-colon + | | | | +- SType + | | | | +- TypeIdentifier + | | | | +- TypeName + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- CodeBlock + | | | +- T-lbrace + | | | +- Statements + | | | | +- Statement + | | | | +- ControlTransferStatement + | | | | +- ReturnStatement + | | | | +- T-return + | | | | +- Expression + | | | | +- PrefixExpression + | | | | +- PostfixExpression + | | | | | +- PrimaryExpression + | | | | | +- Identifier + | | | | | +- T-Identifier + | | | | +- PostfixExpression + | | | | +- T-dot + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- T-rbrace + | | +- StructMember + | | +- Declaration + | | +- VariableDeclaration + | | +- VariableDeclarationHead + | | | +- DeclarationModifiers + | | | | +- DeclarationModifier + | | | | +- AccessLevelModifier + | | | | +- T-public + | | | +- T-var + | | +- VariableName + | | | +- Identifier + | | | +- T-Identifier + | | +- TypeAnnotation + | | | +- T-colon + | | | +- SType + | | | +- TypeIdentifier + | | | +- TypeName + | | | +- Identifier + | | | +- T-Identifier + | | +- CodeBlock + | | +- T-lbrace + | | +- Statements + | | | +- Statement + | | | +- ControlTransferStatement + | | | +- ReturnStatement + | | | +- T-return + | | | +- Expression + | | | +- PrefixExpression + | | | +- PostfixExpression + | | | | +- PrimaryExpression + | | | | +- Identifier + | | | | +- T-Identifier + | | | +- PostfixExpression + | | | +- T-dot + | | | +- Identifier + | | | +- T-Identifier + | | +- T-rbrace + | +- T-rbrace + +- EOF