public ConstantFieldDeclarationNode(Token token, ParseNodeList attributes, Modifiers modifiers, ParseNode type, ParseNodeList initializers) : base(ParseNodeType.ConstFieldDeclaration, token, attributes, modifiers, type, initializers, false) { }
public UsingNode(Token token, ParseNode guard, ParseNode body) : base(ParseNodeType.Using, token) { _guard = GetParentedNode(guard); _body = GetParentedNode(body); }
public DestructorDeclarationNode(Token token, ParseNodeList attributes, Modifiers modifiers, AtomicNameNode name, BlockStatementNode body) : base(ParseNodeType.DestructorDeclaration, token, attributes, modifiers, /* return type */ null, name, new ParseNodeList(), body) { }
public AttributeBlockNode(Token token, AttributeTargets location, ParseNodeList attributes) : base(ParseNodeType.AttributeBlock, token) { _location = location; _attributes = GetParentedNodeList(attributes); }
private void ReportError(Error error, Token token, params object[] args) { BufferPosition newPosition = token.Position; if (OnError != null && lastErrorPosition != newPosition) { OnError(this, new ErrorEventArgs(error, newPosition, args)); } lastErrorPosition = newPosition; }
public SwitchSectionNode(Token token, ParseNodeList labels, ParseNodeList statements) : base(ParseNodeType.SwitchSection, token) { _labels = GetParentedNodeList(labels); _statements = GetParentedNodeList(statements); }
public SwitchNode(Token token, ParseNode condition, ParseNodeList cases) : base(ParseNodeType.Switch, token) { _condition = GetParentedNode(condition); _cases = GetParentedNodeList(cases); }
public LockNode(Token token, ParseNode monitor, ParseNode body) : base(ParseNodeType.Lock, token) { this.monitor = GetParentedNode(monitor); this.body = GetParentedNode(body); }
public FixedNode(Token token, VariableDeclarationNode declaration, ParseNode body) : base(ParseNodeType.Fixed, token) { _declaration = (VariableDeclarationNode)GetParentedNode(declaration); _body = GetParentedNode(body); }
/// <summary> /// Preprocesses, Lexes and Parses a C# compilation unit. Subscribe to the OnError /// event before calling this method to receive error notifications. /// After calling Parse, the Defines property contains the list of preprocessor /// symbols defined as a result of #define and #undef directives in this /// compilation unit. /// </summary> public CompilationUnitNode Parse(Token[] tokens, LineMap lineMap) { _lineMap = lineMap; CompilationUnitNode parseTree = _parser.Parse(tokens); _lineMap = null; return parseTree; }
public DoWhileNode(Token token, ParseNode body, ParseNode condition) : base(ParseNodeType.DoWhile, token) { _body = GetParentedNode(body); _condition = GetParentedNode(condition); }
public VariableDeclarationNode(Token token, ParseNodeList attributes, Modifiers modifiers, ParseNode type, ParseNodeList initializers, bool isFixed) : this(ParseNodeType.VariableDeclaration, token, attributes, modifiers, type, initializers, isFixed) { }
/// <summary> /// Parses an array of C# tokens. Subscribe to the OnError event before /// calling Parse to receive errors while Parsing. /// </summary> public CompilationUnitNode Parse(Token[] tokens) { this.tokens = tokens; iToken = 0; lastErrorPosition.Column = -1; return ParseCompilationUnit(); }
public CatchNode(Token token, ParseNode type, AtomicNameNode name, ParseNode body) : base(ParseNodeType.Catch, token) { _type = GetParentedNode(type); _name = (AtomicNameNode)GetParentedNode(name); _body = GetParentedNode(body); }
public NamespaceNode(Token token, string name, ParseNodeList usingClauses, ParseNodeList members) : base(ParseNodeType.Namespace, token) { _name = name; _usingClauses = GetParentedNodeList(usingClauses); _members = GetParentedNodeList(members); }
public ArrayNewNode(Token token, ParseNode typeReference, ParseNode expressionList, ParseNode initializerExpression) : base(ParseNodeType.ArrayNew, token) { _typeReference = GetParentedNode(typeReference); _expressionList = GetParentedNode(expressionList); _initializerExpression = GetParentedNode(initializerExpression); }
public IfElseNode(Token token, ParseNode condition, ParseNode ifBlock, ParseNode elseBlock) : base(ParseNodeType.IfElse, token) { _condition = GetParentedNode(condition); _ifBlock = GetParentedNode(ifBlock); _elseBlock = GetParentedNode(elseBlock); }
public TryNode(Token token, ParseNode body, ParseNodeList catchClauses, ParseNode finallyClause) : base(ParseNodeType.Try, token) { _body = GetParentedNode(body); _catchClauses = GetParentedNodeList(catchClauses); _finallyClause = GetParentedNode(finallyClause); }
public OperatorDeclarationNode(Token token, ParseNodeList attributes, Modifiers modifiers, TokenType operatorNodeType, ParseNode returnType, ParseNodeList formals, BlockStatementNode body) : base(ParseNodeType.OperatorDeclaration, token, attributes, modifiers, returnType, /* name */ null, formals, body) { this.operatorTokenType = operatorNodeType; }
public NamespaceNode(Token token, NameNode nameNode, ParseNodeList externAliases, ParseNodeList usingClauses, ParseNodeList members) : base(ParseNodeType.Namespace, token) { _name = nameNode.Name; _externAliases = GetParentedNodeList(externAliases); _usingClauses = GetParentedNodeList(usingClauses); _members = GetParentedNodeList(members); }
public ForNode(Token token, ParseNode initializer, ParseNode condition, ParseNode increment, ParseNode body) : base(ParseNodeType.For, token) { _initializer = GetParentedNode(initializer); _condition = GetParentedNode(condition); _increment = GetParentedNode(increment); _body = GetParentedNode(body); }
public ParameterNode(Token token, ParseNodeList attributes, ParameterFlags flags, ParseNode type, AtomicNameNode name) : base(ParseNodeType.FormalParameter, token) { _attributes = GetParentedNodeList(AttributeNode.GetAttributeList(attributes)); _flags = flags; _type = GetParentedNode(type); _name = (AtomicNameNode)GetParentedNode(name); }
public CompilationUnitNode(Token token, ParseNodeList externAliases, ParseNodeList usingClauses, ParseNodeList attributes, ParseNodeList members) : base(ParseNodeType.CompilationUnit, token) { _externAliases = GetParentedNodeList(externAliases); _usingClauses = GetParentedNodeList(usingClauses); _attributes = GetParentedNodeList(attributes); _members = GetParentedNodeList(GetNamespaces(members)); }
public PropertyDeclarationNode(Token token, ParseNodeList attributes, Modifiers modifiers, ParseNode type, NameNode interfaceType, AtomicNameNode name, AccessorNode getOrRemove, AccessorNode setOrAdd) : this(ParseNodeType.PropertyDeclaration, token, attributes, modifiers, type, interfaceType, getOrRemove, setOrAdd) { _name = (AtomicNameNode)GetParentedNode(name); }
public ForeachNode(Token token, ParseNode type, AtomicNameNode name, ParseNode container, ParseNode body) : base(ParseNodeType.Foreach, token) { _type = GetParentedNode(type); _name = (AtomicNameNode)GetParentedNode(name); _container = GetParentedNode(container); _body = GetParentedNode(body); }
public AccessorNode(Token token, ParseNodeList attributes, AtomicNameNode name, BlockStatementNode body, Modifiers modifiers) : base(ParseNodeType.AccessorDeclaration, token) { _name = (AtomicNameNode)GetParentedNode(name); _implementation = (BlockStatementNode)GetParentedNode(body); _attributes = GetParentedNodeList(attributes); _modifiers = modifiers; }
public IndexerDeclarationNode(Token token, ParseNodeList attributes, Modifiers modifiers, ParseNode type, NameNode interfaceType, ParseNodeList parameters, AccessorNode get, AccessorNode set) : base(ParseNodeType.IndexerDeclaration, token, attributes, modifiers, type, interfaceType, get, set) { _parameters = GetParentedNodeList(parameters); }
public ConstructorDeclarationNode(Token token, ParseNodeList attributes, Modifiers modifiers, AtomicNameNode name, ParseNodeList formals, bool callBase, ParseNode baseArguments, BlockStatementNode body) : base(ParseNodeType.ConstructorDeclaration, token, attributes, modifiers, /* return type */ null, name, formals, body) { _callBase = callBase; _baseArguments = GetParentedNode(baseArguments); }
public DelegateTypeNode(Token token, ParseNodeList attributes, Modifiers modifiers, ParseNode returnType, AtomicNameNode name, ParseNodeList typeParameters, ParseNodeList parameters, ParseNodeList constraintClauses) : base(ParseNodeType.Delegate, token, TokenType.Delegate, attributes, modifiers, name, typeParameters, constraintClauses) { _returnType = GetParentedNode(returnType); _parameters = GetParentedNodeList(parameters); }
public CustomTypeNode(Token token, TokenType type, ParseNodeList attributes, Modifiers modifiers, AtomicNameNode name, ParseNodeList typeParameters, ParseNodeList baseTypes, ParseNodeList constraintClauses, ParseNodeList members) : base(ParseNodeType.Type, token, type, attributes, modifiers, name, typeParameters, constraintClauses) { _baseTypes = GetParentedNodeList(baseTypes); _members = GetParentedNodeList(members); }