logoISU  

CS 456 - Systems Programming

Spring 2024

Displaying ./code/apr11/y.output

Grammar

    0 $accept: commands $end

    1 commands: ε
    2         | commands command

    3 command: heat_switch
    4        | target_set
    5        | heater_select

    6 heat_switch: TOKHEAT STATE

    7 target_set: TOKTARGET TOKTEMPERATURE NUMBER

    8 heater_select: TOKHEATER WORD


Terminals, with rules where they appear

    $end (0) 0
    error (256)
    TOKHEATER (258) 8
    TOKHEAT (259) 6
    TOKTARGET (260) 7
    TOKTEMPERATURE (261) 7
    STATE <number> (262) 6
    NUMBER <number> (263) 7
    WORD <string> (264) 8


Nonterminals, with rules where they appear

    $accept (10)
        on left: 0
    commands (11)
        on left: 1 2
        on right: 0 2
    command (12)
        on left: 3 4 5
        on right: 2
    heat_switch (13)
        on left: 6
        on right: 3
    target_set (14)
        on left: 7
        on right: 4
    heater_select (15)
        on left: 8
        on right: 5


State 0

    0 $accept: • commands $end

    $default  reduce using rule 1 (commands)

    commands  go to state 1


State 1

    0 $accept: commands • $end
    2 commands: commands • command

    $end       shift, and go to state 2
    TOKHEATER  shift, and go to state 3
    TOKHEAT    shift, and go to state 4
    TOKTARGET  shift, and go to state 5

    command        go to state 6
    heat_switch    go to state 7
    target_set     go to state 8
    heater_select  go to state 9


State 2

    0 $accept: commands $end •

    $default  accept


State 3

    8 heater_select: TOKHEATER • WORD

    WORD  shift, and go to state 10


State 4

    6 heat_switch: TOKHEAT • STATE

    STATE  shift, and go to state 11


State 5

    7 target_set: TOKTARGET • TOKTEMPERATURE NUMBER

    TOKTEMPERATURE  shift, and go to state 12


State 6

    2 commands: commands command •

    $default  reduce using rule 2 (commands)


State 7

    3 command: heat_switch •

    $default  reduce using rule 3 (command)


State 8

    4 command: target_set •

    $default  reduce using rule 4 (command)


State 9

    5 command: heater_select •

    $default  reduce using rule 5 (command)


State 10

    8 heater_select: TOKHEATER WORD •

    $default  reduce using rule 8 (heater_select)


State 11

    6 heat_switch: TOKHEAT STATE •

    $default  reduce using rule 6 (heat_switch)


State 12

    7 target_set: TOKTARGET TOKTEMPERATURE • NUMBER

    NUMBER  shift, and go to state 13


State 13

    7 target_set: TOKTARGET TOKTEMPERATURE NUMBER •

    $default  reduce using rule 7 (target_set)