protected virtual void VisitVarDeclaration(VarDeclarationNode node)
 {
     Visit(node.TypeNameNode);
     Visit(node.NameNode);
     if (node.RightSideNode != null)
     {
         Visit(node.RightSideNode);
     }
 }
Exemple #2
0
 protected virtual T VisitVarDeclaration(VarDeclarationNode node)
 {
     Visit(node.TypeNameNode);
     Visit(node.NameNode);
     if (node.RightSideNode != null)
     {
         Visit(node.RightSideNode);
     }
     return(DefaultResult);
 }
Exemple #3
0
        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);
        }
Exemple #4
0
 protected override void VisitVarDeclaration(VarDeclarationNode varDeclarationNode)
 {
     BuildVar(varDeclarationNode);
 }