예제 #1
0
        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");
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
 public void ExitPrintseparator(BASICParser.PrintseparatorContext context)
 {
     currentPrintSeparator = context.GetText().Equals(",") ? PrintList.printseparator.COMMA : PrintList.printseparator.SEMICOLON;
 }
예제 #4
0
 public void ExitPrintlist(BASICParser.PrintlistContext context)
 {
     currentPrintSeparator = PrintList.printseparator.NULL;
 }