Exemplo n.º 1
0
 public override void CaseAStructDecl(AStructDecl node)
 {
     InAStructDecl(node);
     {
         Object[] temp = new Object[node.GetLocals().Count];
         node.GetLocals().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((PLocalDecl)temp[i]).Apply(this);
         }
     }
     if (node.GetBase() != null)
     {
         node.GetBase().Apply(this);
     }
     {
         Object[] temp = new Object[node.GetGenericVars().Count];
         node.GetGenericVars().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((TIdentifier)temp[i]).Apply(this);
         }
     }
     if (node.GetName() != null)
     {
         node.GetName().Apply(this);
     }
     if (node.GetEndToken() != null)
     {
         node.GetEndToken().Apply(this);
     }
     if (node.GetIntDim() != null)
     {
         node.GetIntDim().Apply(this);
     }
     if (node.GetDimention() != null)
     {
         node.GetDimention().Apply(this);
     }
     if (node.GetClassToken() != null)
     {
         node.GetClassToken().Apply(this);
     }
     if (node.GetVisibilityModifier() != null)
     {
         node.GetVisibilityModifier().Apply(this);
     }
     OutAStructDecl(node);
 }
 public override void CaseAStructDecl(AStructDecl node)
 {
     if (node.GetDimention() != null)
     {
         bool prevFolding = folding;
         int prevValue = value;
         bool wasANewExp = isANewExp;
         folding = true;
         value = 0;
         node.GetDimention().Apply(this);
         node.SetIntDim(new TIntegerLiteral(value.ToString()));
         folding = prevFolding;
         value = prevValue;
         isANewExp = wasANewExp;
     }
     base.CaseAStructDecl(node);
 }
 public override void CaseAStructDecl(AStructDecl node)
 {
     if (node.GetDimention() != null && !data.IsLiteCompile)
     {
         //Find int dim
         foldIntegerConstants = true;
         isInANewExp = true;//If false, we dont require a value
         node.GetDimention().Apply(this);
         isInANewExp = false;
         foldIntegerConstants = false;
         if (foldingFailed)
         {
             errors.Add(new ErrorCollection.Error(node.GetName(), currentSourceFile, LocRM.GetString("ErrorText166")));
             throw new ParserException(node.GetName(), "TypeLinking.CaseAStructDecl");
         }
         node.SetIntDim(new TIntegerLiteral(integerConstant.ToString()));
     }
     base.CaseAStructDecl(node);
 }