Exemplo n.º 1
0
        private StatementList parseStatementList()
        {
            StatementList sl = new StatementList();

            if (currentScannerToken != GingerToken.CloseList)
            {
                do
                {
                    try
                    {
                        sl.add(parseStatement());
                    }
                    catch (ParseException pe)
                    {
                        _errors.Add(pe);
                    }

                    nextScannerToken();
                } while (currentScannerToken != GingerToken.CloseList);
            }

            return(sl);
        }
Exemplo n.º 2
0
        private StatementList parseStatementList(GingerToken endToken)
        {
            StatementList sl = new StatementList();
            do
            {
                try
                {
                    sl.add(parseStatement());
                }
                catch (ParseException pe)
                {
                    _errors.Add(pe);
                }

                nextScannerToken();

                if (currentScannerToken != endToken && currentScannerToken == GingerToken.EndOfFile)
                {
                    _errors.Add(new ParseException(scanner.row, scanner.col, $"Expected '{endToken.ToString()}', found '{currentScannerToken.ToString()}'", ExceptionLevel.ERROR));
                }
            } while (currentScannerToken != endToken && currentScannerToken != GingerToken.EndOfFile);

            return sl;
        }
Exemplo n.º 3
0
 public CFGBasicBlock()
 {
     statementList = new StatementList();
 }
Exemplo n.º 4
0
 public void parse()
 {
     nextScannerToken();
     statementList = parseStatementList(GingerToken.EndOfFile);
 }