straightline/src/main/java/org/poormanscastle/studies/compilers/grammar/grammar_oh/ast/domain/Type.java
/**
     * queries the type transition matrix for the next state. the matrix holds the information
     *
     * @param state
     * @param type
     * @return
     */
queries the type transition matrix for the next state. the matrix holds the information
@param state
@param type
@return
queries the type transition matrix for the next state . the matrix holds the information @param state @param type @return
private static int queryAssignabilityMatrix(int state, Type type) {
        switch (state) {
            case 0:
                return 0;
            case 1:
                switch (type) {
                    case BOOLEAN:
                        return 2;
                    case INT:
                        return 4;
                    case DOUBLE:
                        return 6;
                    case TEXT:
                        return 9;
                    default:
                        return 0;
                }
            case 2:
                switch (type) {
                    case BOOLEAN:
                        return 3;
                    default:
                        return 0;
                }
            case 4:
                switch (type) {
                    case INT:
                        return 5;
                    default:
                        return 0;
                }
            case 6:
                switch (type) {
                    case INT:
                        return 7;
                    case DOUBLE:
                        return 8;
                    default:
                        return 0;
                }
            case 9:
                switch (type) {
                    case TEXT:
                        return 10;
                    default:
                        return 0;
                }
            default:
                return 0;
        }
    }
private static int queryAssignabilityMatrix ( int state , Type type ) { switch ( state ) { case 0 : return 0 ; case 1 : switch ( type ) { case BOOLEAN : return 2 ; case INT : return 4 ; case DOUBLE : return 6 ; case TEXT : return 9 ; default : return 0 ; } case 2 : switch ( type ) { case BOOLEAN : return 3 ; default : return 0 ; } case 4 : switch ( type ) { case INT : return 5 ; default : return 0 ; } case 6 : switch ( type ) { case INT : return 7 ; case DOUBLE : return 8 ; default : return 0 ; } case 9 : switch ( type ) { case TEXT : return 10 ; default : return 0 ; } default : return 0 ; } }
queries the type transition matrix for the next state.
queries the type transition matrix for the next state .