public override void ExitArray_varDeclaration(NewDecafParser.Array_varDeclarationContext context) { FieldDeclaration FD = new FieldDeclaration(); VarType currentTypeName = getNodeCommand(context.varType()) as VarType; FD.TypeName = currentTypeName; FD.FieldId = context.Id().GetText(); FD.IsArray = true; mainClass.addCommand(FD); ArrayDeclaration AD = new ArrayDeclaration { Type = currentTypeName.getGenCode(), Name = FD.FieldId, ArraySize = Convert.ToInt32(context.Num().GetText()) }; mainClass.addCommand(AD); }
public void addCommand(ArrayDeclaration theCommand) { arrayDeclList.Add(theCommand); }