private static void doFlat(CompilerState state, char c) { state.result = new RENode(REOP_FLAT); state.result.chr = c; state.result.length = 1; state.result.flatIndex = -1; state.progLength += 3; }
private static void doFlat(CompilerState state, char c) { state.result = new RENode(REOP_FLAT); state.result.chr = c; state.result.length = 1; state.result.flatIndex = -1; state.progLength += 3; }
private static void doFlat(CompilerState state, char c) { state.result = new RENode(REOP_FLAT); state.result.chr = c; state.result.length = 1; state.result.flatIndex = -1; state.progLength += 3; }
private static void doFlat(CompilerState state, char c) { state.result = new RENode(REOP_FLAT); state.result.chr = c; state.result.length = 1; state.result.flatIndex = -1; state.progLength += 3; }
private static void doFlat(CompilerState state, char c) { state.result = new RENode(REOP_FLAT); state.result.chr = c; state.result.length = 1; state.result.flatIndex = -1; state.progLength += 3; }
private static void doFlat(CompilerState state, char c) { state.result = new RENode(REOP_FLAT); state.result.chr = c; state.result.length = 1; state.result.flatIndex = -1; state.progLength += 3; }
private static boolean parseAlternative(CompilerState state) { RENode headTerm = null; RENode tailTerm = null; char[] source = state.cpbegin; while (true) { if (state.cp == state.cpend || source[state.cp] == '|' || (state.parenNesting != 0 && source[state.cp] == ')')) { if (headTerm == null) { state.result = new RENode(REOP_EMPTY); } else state.result = headTerm; return true; } if (!parseTerm(state)) return false; if (headTerm == null) { headTerm = state.result; tailTerm = headTerm; } else tailTerm.next = state.result; while (tailTerm.next != null) tailTerm = tailTerm.next; } }
private static boolean parseAlternative(CompilerState state) { RENode headTerm = null; RENode tailTerm = null; char[] source = state.cpbegin; while (true) { if (state.cp == state.cpend || source[state.cp] == '|' || (state.parenNesting != 0 && source[state.cp] == ')')) { if (headTerm == null) { state.result = new RENode(REOP_EMPTY); } else state.result = headTerm; return true; } if (!parseTerm(state)) return false; if (headTerm == null) { headTerm = state.result; tailTerm = headTerm; } else tailTerm.next = state.result; while (tailTerm.next != null) tailTerm = tailTerm.next; } }
private static boolean parseAlternative(CompilerState state) { RENode headTerm = null; RENode tailTerm = null; char[] source = state.cpbegin; while (true) { if (state.cp == state.cpend || source[state.cp] == '|' || (state.parenNesting != 0 && source[state.cp] == ')')) { if (headTerm == null) { state.result = new RENode(REOP_EMPTY); } else state.result = headTerm; return true; } if (!parseTerm(state)) return false; if (headTerm == null) { headTerm = state.result; tailTerm = headTerm; } else tailTerm.next = state.result; while (tailTerm.next != null) tailTerm = tailTerm.next; } }
private static boolean parseAlternative(CompilerState state) { RENode headTerm = null; RENode tailTerm = null; char[] source = state.cpbegin; while (true) { if (state.cp == state.cpend || source[state.cp] == '|' || (state.parenNesting != 0 && source[state.cp] == ')')) { if (headTerm == null) { state.result = new RENode(REOP_EMPTY); } else state.result = headTerm; return true; } if (!parseTerm(state)) return false; if (headTerm == null) { headTerm = state.result; tailTerm = headTerm; } else tailTerm.next = state.result; while (tailTerm.next != null) tailTerm = tailTerm.next; } }
state.result = new RENode(REOP_EMPTY);
state.result = new RENode(REOP_EMPTY);
private static boolean parseDisjunction(CompilerState state) { if (!parseAlternative(state)) return false; char[] source = state.cpbegin; int index = state.cp; if (index != source.length && source[index] == '|') { RENode altResult; ++state.cp; altResult = new RENode(REOP_ALT); altResult.kid = state.result; if (!parseDisjunction(state)) return false; altResult.kid2 = state.result; state.result = altResult; /* ALT, <next>, ..., JUMP, <end> ... JUMP <end> */ state.progLength += 9; } return true; }
private static boolean parseDisjunction(CompilerState state) { if (!parseAlternative(state)) return false; char[] source = state.cpbegin; int index = state.cp; if (index != source.length && source[index] == '|') { RENode altResult; ++state.cp; altResult = new RENode(REOP_ALT); altResult.kid = state.result; if (!parseDisjunction(state)) return false; altResult.kid2 = state.result; state.result = altResult; /* ALT, <next>, ..., JUMP, <end> ... JUMP <end> */ state.progLength += 9; } return true; }
RENode result; ++state.cp; result = new RENode(REOP_ALT); result.kid = state.result; if (!parseDisjunction(state))
RENode result; ++state.cp; result = new RENode(REOP_ALT); result.kid = state.result; if (!parseDisjunction(state))
RENode result; ++state.cp; result = new RENode(REOP_ALT); result.kid = state.result; if (!parseDisjunction(state))
RENode result; ++state.cp; result = new RENode(REOP_ALT); result.kid = state.result; if (!parseDisjunction(state))
System.out.println("flat = \"" + str + "\""); state.result = new RENode(REOP_FLAT); state.result.chr = state.cpbegin[0]; state.result.length = length;
System.out.println("flat = \"" + str + "\""); state.result = new RENode(REOP_FLAT); state.result.chr = state.cpbegin[0]; state.result.length = length;