public void compileString() { for (int i = 0; i < printList.items.Count; i++) { PrintItem thisItem = printList.items[i]; if (thisItem.stringExpr == null) { printNumericExpression(thisItem.numExpr); } else { printStringExpression(thisItem.stringExpr); } if (i < printList.separators.Count) { PrintList.printseparator thisSeparator = printList.separators[i]; if (thisSeparator == PrintList.printseparator.COMMA) { printLiteral(","); } if (thisSeparator == PrintList.printseparator.SEMICOLON) { printLiteral(";"); } } } printLiteral("\r\n"); }
public void ExitPrintitem(BASICParser.PrintitemContext context) { if (currentStringExpression == null) { currentPrintItem = new PrintItem(currentNumericExpression.Pop()); } else { currentPrintItem = new PrintItem(currentStringExpression.Pop()); } if (currentPrintSeparator == PrintList.printseparator.NULL) { currentPrintList.add(currentPrintItem); } else { currentPrintList.add(currentPrintItem, currentPrintSeparator); currentPrintSeparator = PrintList.printseparator.NULL; } }
public void ExitPrintseparator(BASICParser.PrintseparatorContext context) { currentPrintSeparator = context.GetText().Equals(",") ? PrintList.printseparator.COMMA : PrintList.printseparator.SEMICOLON; }
public void ExitPrintlist(BASICParser.PrintlistContext context) { currentPrintSeparator = PrintList.printseparator.NULL; }