public FixedNode(Token token, VariableDeclarationNode declaration, ParseNode body) : base(ParseNodeType.Fixed, token) { _declaration = (VariableDeclarationNode)GetParentedNode(declaration); _body = GetParentedNode(body); }
private Statement ProcessVariableDeclarationStatement(VariableDeclarationNode node) { VariableDeclarationStatement statement = new VariableDeclarationStatement(); TypeSymbol variableType = _symbolSet.ResolveType(node.Type, _symbolTable, _memberContext); foreach (VariableInitializerNode initializerNode in node.Initializers) { string name = initializerNode.Name.Name; VariableSymbol symbol = new VariableSymbol(name, _memberContext, variableType); if (initializerNode.Value != null) { Expression value = _expressionBuilder.BuildExpression(initializerNode.Value); if (value is MemberExpression) { value = _expressionBuilder.TransformMemberExpression((MemberExpression)value); } symbol.SetValue(value); } _symbolTable.AddSymbol(symbol); statement.AddVariable(symbol); } return statement; }
private ParseNode ParseEvent(Token token, ParseNodeList attributes, Modifiers modifiers) { ParseNode backingMember; NextToken(); // event ParseNode type = ParseType(); NameNode interfaceType; switch (ParseMemberName(out interfaceType)) { case ScanMemberNameKind.Property: backingMember = ParseProperty(token, new ParseNodeList(), modifiers, type, interfaceType, true); break; case ScanMemberNameKind.Field: default: ReportInterfaceVariable(interfaceType); backingMember = new VariableDeclarationNode( token, new ParseNodeList(), modifiers, type, ParseFieldInitializersStatement(false), false); break; } return new EventDeclarationNode( token, attributes, backingMember); }