protected virtual void VisitVarDeclaration(VarDeclarationNode node) { Visit(node.TypeNameNode); Visit(node.NameNode); if (node.RightSideNode != null) { Visit(node.RightSideNode); } }
protected virtual T VisitVarDeclaration(VarDeclarationNode node) { Visit(node.TypeNameNode); Visit(node.NameNode); if (node.RightSideNode != null) { Visit(node.RightSideNode); } return(DefaultResult); }
private void BuildVar(VarDeclarationNode varDeclarationNode, bool buildArray = false) { string varName = varDeclarationNode.NameNode.Value; string varTypeName = varDeclarationNode.TypeNameCapitalized; BlockSymbol parentBlockSymbol = GetParentBlockSymbol(varDeclarationNode); VarSymbol varSymbol; if (parentBlockSymbol is ClassSymbol) { varSymbol = buildArray ? new AttributeArraySymbol(parentBlockSymbol, varTypeName, varName, varDeclarationNode) : new AttributeSymbol(parentBlockSymbol, varTypeName, varName, varDeclarationNode); } else { varSymbol = buildArray ? new VarArraySymbol(parentBlockSymbol, varTypeName, varName, varDeclarationNode) : new VarSymbol(parentBlockSymbol, varTypeName, varName, varDeclarationNode); } AddSymbol(varSymbol); }
protected override void VisitVarDeclaration(VarDeclarationNode varDeclarationNode) { BuildVar(varDeclarationNode); }