Пример #1
0
bool State8::transition(Automaton &automaton, Symbol *symbol) {
    switch (symbol->getId()) {

            /*
             * id : E14
             */

        case S_VARIABLE:
            automaton.addVariableToCurrentDeclarationVar((SymbolVariable *) symbol);
            automaton.transition(symbol, new State14());
            return true;

            /*
             * V : E13
             */

        case SYMBOL_UNTERMINAL_V:
            automaton.transition(symbol, new State13());
            return true;

        default:
            throw ErrorLexicalUnexpectedSymbol(symbol->toString(), symbol->getNumLineDetection(),
                                               symbol->getNumCharDetection());

    }
}
Пример #2
0
bool State27::transition(Automaton &automaton, Symbol *symbol) {
    switch (symbol->getId()) {

            /*
             * val : E37
             */

        case S_NUMBER:
            automaton.addConstantValueToCurrentDeclarationConst((SymbolNumber *) symbol);
            automaton.transition(symbol, new State37());
            return true;

        default:
            throw ErrorLexicalUnexpectedSymbol(symbol->toString(), symbol->getNumLineDetection(),
                                               symbol->getNumCharDetection());

    }
}