Grammar:
 statement -> <2> ID(nonTerminal) ASSIGN productionStatementBody(body) SEMICOLON productionStatementCode(code)    {  v = new ProductionStatementNode(nonTerminal.id, body.getProduction(), code);  }
            | <9> TYPE ID(symbol) ID(type)    {  v = new TypeStatementNode(symbol.id, type.id);  }
            | <10> TYPE ID(symbol) CODE(c)    {  v = new TypeStatementNode(symbol.id, c.code);  }
            | <11> TOP CODE(c)    {  v = new TopStatementNode(c.code);  }
            | <12> NAME ID(name)    {  v = new NameStatementNode(name.id);  }
            | <13> ALGO ID(alg)    {  v = new AlgoStatementNode(alg.id);  }
            | <14> TARGET ID(target)    {  v = new TargetStatementNode(target.id);  };
StranslationUnit' -> <15> translationUnit;
 productionStatementBody -> <3>     {  v = new ProductionStatementBody();  }
                          | <4> productionStatementBody(b) ID(s) productionStatementArgument(arg)    { 
     if (StringUtils.isTerminal(s.id)) {
         if (arg == null) {
             b.addTerminal(s.id);
         }
         else {
             b.addTerminal(s.id, arg.id);
         }
     }
     else {
         if (arg == null) {
             b.addNonTerminal(s.id);
         }
         else {
             b.addNonTerminal(s.id, arg.id);
         }
     }
     v = b;
  };
 translationUnit -> <0>     {  v = new TranslationUnitNode();  }
                  | <1> translationUnit(t) statement(s)    {  t.addStatement(s); v = t;  };
 productionStatementArgument -> <7>     {  v = null;  }
                              | <8> LEFT_PAREN ID(arg) RIGHT_PAREN    {  v = arg;  };
 productionStatementCode -> <5>     {  v = null;  }
                          | <6> CODE(c)    {  v = c;  };

First sets:
FIRST(statement) = {NAME, ALGO, TOP, TARGET, ID, TYPE}
FIRST(translationUnit') = {, NAME, ALGO, TOP, TARGET, ID, TYPE}
FIRST(productionStatementBody) = {, ID}
FIRST(translationUnit) = {, NAME, ALGO, TOP, TARGET, ID, TYPE}
FIRST(productionStatementArgument) = {, LEFT_PAREN}
FIRST(productionStatementCode) = {, CODE}

Follow sets:
FOLLOW(statement) = {NAME, ALGO, EOF, TOP, TARGET, ID, TYPE}
FOLLOW(translationUnit') = {EOF}
FOLLOW(productionStatementBody) = {SEMICOLON, ID}
FOLLOW(translationUnit) = {NAME, ALGO, EOF, TOP, TARGET, ID, TYPE}
FOLLOW(productionStatementArgument) = {SEMICOLON, ID}
FOLLOW(productionStatementCode) = {NAME, ALGO, EOF, TOP, TARGET, ID, TYPE}

Automation:
Non-terminal count: 5
Terminal count: 12
State count: 26 (0 - 25)

Action table:
STATE |      TARGET |        CODE |         TOP |   SEMICOLON | RIGHT_PAREN |          ID |      ASSIGN |  LEFT_PAREN |        TYPE |        ALGO |        NAME |         EOF
   0  |          r0 | ----------- |          r0 | ----------- | ----------- |          r0 | ----------- | ----------- |          r0 |          r0 |          r0 |          r0
   1  |          s6 | ----------- |          s5 | ----------- | ----------- |          s7 | ----------- | ----------- |          s8 |          s4 |          s3 |      accept
   2  |          r1 | ----------- |          r1 | ----------- | ----------- |          r1 | ----------- | ----------- |          r1 |          r1 |          r1 |          r1
   3  | ----------- | ----------- | ----------- | ----------- | ----------- |          s9 | ----------- | ----------- | ----------- | ----------- | ----------- | -----------
   4  | ----------- | ----------- | ----------- | ----------- | ----------- |         s10 | ----------- | ----------- | ----------- | ----------- | ----------- | -----------
   5  | ----------- |         s11 | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | -----------
   6  | ----------- | ----------- | ----------- | ----------- | ----------- |         s12 | ----------- | ----------- | ----------- | ----------- | ----------- | -----------
   7  | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- |         s13 | ----------- | ----------- | ----------- | ----------- | -----------
   8  | ----------- | ----------- | ----------- | ----------- | ----------- |         s14 | ----------- | ----------- | ----------- | ----------- | ----------- | -----------
   9  |         r12 | ----------- |         r12 | ----------- | ----------- |         r12 | ----------- | ----------- |         r12 |         r12 |         r12 |         r12
  10  |         r13 | ----------- |         r13 | ----------- | ----------- |         r13 | ----------- | ----------- |         r13 |         r13 |         r13 |         r13
  11  |         r11 | ----------- |         r11 | ----------- | ----------- |         r11 | ----------- | ----------- |         r11 |         r11 |         r11 |         r11
  12  |         r14 | ----------- |         r14 | ----------- | ----------- |         r14 | ----------- | ----------- |         r14 |         r14 |         r14 |         r14
  13  | ----------- | ----------- | ----------- |          r3 | ----------- |          r3 | ----------- | ----------- | ----------- | ----------- | ----------- | -----------
  14  | ----------- |         s16 | ----------- | ----------- | ----------- |         s17 | ----------- | ----------- | ----------- | ----------- | ----------- | -----------
  15  | ----------- | ----------- | ----------- |         s18 | ----------- |         s19 | ----------- | ----------- | ----------- | ----------- | ----------- | -----------
  16  |         r10 | ----------- |         r10 | ----------- | ----------- |         r10 | ----------- | ----------- |         r10 |         r10 |         r10 |         r10
  17  |          r9 | ----------- |          r9 | ----------- | ----------- |          r9 | ----------- | ----------- |          r9 |          r9 |          r9 |          r9
  18  |          r5 |         s20 |          r5 | ----------- | ----------- |          r5 | ----------- | ----------- |          r5 |          r5 |          r5 |          r5
  19  | ----------- | ----------- | ----------- |          r7 | ----------- |          r7 | ----------- |         s23 | ----------- | ----------- | ----------- | -----------
  20  |          r6 | ----------- |          r6 | ----------- | ----------- |          r6 | ----------- | ----------- |          r6 |          r6 |          r6 |          r6
  21  |          r2 | ----------- |          r2 | ----------- | ----------- |          r2 | ----------- | ----------- |          r2 |          r2 |          r2 |          r2
  22  | ----------- | ----------- | ----------- |          r4 | ----------- |          r4 | ----------- | ----------- | ----------- | ----------- | ----------- | -----------
  23  | ----------- | ----------- | ----------- | ----------- | ----------- |         s24 | ----------- | ----------- | ----------- | ----------- | ----------- | -----------
  24  | ----------- | ----------- | ----------- | ----------- |         s25 | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | -----------
  25  | ----------- | ----------- | ----------- |          r8 | ----------- |          r8 | ----------- | ----------- | ----------- | ----------- | ----------- | -----------


Goto table:
STATE |             translationUnit |     productionStatementCode | productionStatementArgument |                   statement |     productionStatementBody
   0  |                           1 | --------------------------- | --------------------------- | --------------------------- | ---------------------------
   1  | --------------------------- | --------------------------- | --------------------------- |                           2 | ---------------------------
   2  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
   3  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
   4  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
   5  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
   6  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
   7  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
   8  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
   9  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  10  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  11  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  12  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  13  | --------------------------- | --------------------------- | --------------------------- | --------------------------- |                          15
  14  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  15  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  16  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  17  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  18  | --------------------------- |                          21 | --------------------------- | --------------------------- | ---------------------------
  19  | --------------------------- | --------------------------- |                          22 | --------------------------- | ---------------------------
  20  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  21  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  22  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  23  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  24  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------
  25  | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------


State 0:
    translationUnit' -> * translationUnit

State 1:
    translationUnit -> translationUnit * statement
    translationUnit' -> translationUnit *

State 2:
    translationUnit -> translationUnit statement *

State 3:
    statement -> NAME * ID

State 4:
    statement -> ALGO * ID

State 5:
    statement -> TOP * CODE

State 6:
    statement -> TARGET * ID

State 7:
    statement -> ID * ASSIGN productionStatementBody SEMICOLON productionStatementCode

State 8:
    statement -> TYPE * ID CODE
    statement -> TYPE * ID ID

State 9:
    statement -> NAME ID *

State 10:
    statement -> ALGO ID *

State 11:
    statement -> TOP CODE *

State 12:
    statement -> TARGET ID *

State 13:
    statement -> ID ASSIGN * productionStatementBody SEMICOLON productionStatementCode

State 14:
    statement -> TYPE ID * CODE
    statement -> TYPE ID * ID

State 15:
    statement -> ID ASSIGN productionStatementBody * SEMICOLON productionStatementCode
    productionStatementBody -> productionStatementBody * ID productionStatementArgument

State 16:
    statement -> TYPE ID CODE *

State 17:
    statement -> TYPE ID ID *

State 18:
    statement -> ID ASSIGN productionStatementBody SEMICOLON * productionStatementCode

State 19:
    productionStatementBody -> productionStatementBody ID * productionStatementArgument

State 20:
    productionStatementCode -> CODE *

State 21:
    statement -> ID ASSIGN productionStatementBody SEMICOLON productionStatementCode *

State 22:
    productionStatementBody -> productionStatementBody ID productionStatementArgument *

State 23:
    productionStatementArgument -> LEFT_PAREN * ID RIGHT_PAREN

State 24:
    productionStatementArgument -> LEFT_PAREN ID * RIGHT_PAREN

State 25:
    productionStatementArgument -> LEFT_PAREN ID RIGHT_PAREN *
