Changeset 3628 for proto/RE/src


Ignore:
Timestamp:
Feb 20, 2014, 4:51:17 PM (6 years ago)
Author:
cameron
Message:

Revised while loop for Kleene star avoids unrolled first iteration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/RE/src/codeGenerator/CodeGenerator.java

    r3122 r3628  
    176176                                } else {
    177177                                        out = oG.combineStatements(out, cursorAssign);
    178                                         out = oG.combineStatements(out, body);
    179                                         out = oG.combineStatements(out, oG.makeWhile(oG.makeAnd(oG.makeNot(oG.makeVariable(nodeState.getCursorVariable())),oG.makeVariable(childState.getCursorVariable())), oG.combineStatements(oG.makeAssignment(oG.makeVariable(nodeState.getCursorVariable()), oG.makeOr(oG.makeVariable(nodeState.getCursorVariable()), oG.makeVariable(childState.getCursorVariable()))),body)));
     178                    body = oG.combineStatements(body, oG.makeAssignment(oG.makeVariable(childState.getCursorVariable()), oG.makeAnd(oG.makeVariable(childState.getCursorVariable()), oG.makeNot(oG.makeVariable(nodeState.getCursorVariable())))));
     179
     180                    body = oG.combineStatements(body, oG.makeAssignment(oG.makeVariable(nodeState.getCursorVariable()), oG.makeOr(oG.makeVariable(nodeState.getCursorVariable()), oG.makeVariable(childState.getCursorVariable()))));
     181                   
     182                                        out = oG.combineStatements(out, oG.makeWhile(oG.makeVariable(childState.getCursorVariable()), body));
    180183                                }
    181184                                uHandled=true;
Note: See TracChangeset for help on using the changeset viewer.