public override string go() { string s = null; SyntaxError error = null; Lexems.Lexema l = null; while ((l = getToken()) != null) { lexems.Add(l); } s = new VariableDefinition(this).go(); if (s == null) { error = new VariableDefinitionMissedError(); error.position = 0; } else { s += "CODE SEGMENT\nASSUME CS:CODE, DS:SEG1\nSTART:\n\tmov AX,SEG1\n\tmov DS,AX\n"; CalculationsDescription cd = new CalculationsDescription(this); string calculations= cd.go(); if (calculations != null) { s += calculations; } else { addError ( new CalculationsMissedError(),0); } s += "CODE ENDS\nEND START\n"; } return s; }
public override string go() { string s = ""; Lexems.Lexema l = getToken(); Lexems.Lexema op=l; if (l == null) return null; s = op.Data + "\n"; while ((l = getToken()) != null ) { lexems.Add(l); } if (lexems.Count>0) { calculations = new CalculationsDescription(this).go() + "\n"; } return s; }