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); }