public override void ExitInt_literal_expression(DecafParser.Int_literal_expressionContext context) { setNodeValue(context, Convert.ToInt32(context.Num().GetText())); setNodeType(context, SymbolType.Tint); }
public override void ExitArray_varDeclaration(DecafParser.Array_varDeclarationContext context) { SymbolType theType = getNodeType(context.varType()); string num = context.Num().GetText(); ArraySymbol theSymbolRepresentation; if (theType != SymbolType.TstructImpl) theSymbolRepresentation = new ArraySymbol(theType, Convert.ToInt32(num)); else { StructImpl theSymbol = getNodeSymbol(context.varType()) as StructImpl; theSymbolRepresentation = new StructArraySymbol(theType, Convert.ToInt32(num), theSymbol.ParentStructName); } theScopeManager.AddSymbol(context.Id().GetText(), theSymbolRepresentation); }