Download mlBNF
Transcript
215
210
205
200
195
190
// <U> ::= "bc" {}
private void parse_L_3_1() throws Exception {
tokenLength = getInputTokenAt(lexer, ci, 3).length;
cr = getNodeT(3, ci, ci + tokenLength, lexer.getLexeme(ci, tokenLength));
ci = ci + tokenLength;
cn = getNodeP(new int[] {2, 0, 1}, cn, cr);
// <U> ::= "bc" {}
private void parse_L_3() throws Exception {
if (test(lexer.get(ci, new int[] {3}), 2, new int[] {2, 0, 0})) {
add(Label.L_3_1, cu, ci, SPPFNode.DUMMY);
}
label = Label.L_0;
}
// <U>
private void parse_R_3_1() throws Exception {
pop();
label = Label.L_0;
}
private void parse_L_2_2() throws Exception {
tokenLength = getInputTokenAt(lexer, ci, 2).length;
cn = getNodeT(2, ci, ci + tokenLength, lexer.getLexeme(ci, tokenLength));
ci = ci + tokenLength;
if (!test(lexer.get(ci, new int[] {3}), 2, new int[] {1, 1, 1})) {
label = Label.L_0;
return;
}
cu = create(Label.R_3_1, new int[] {1, 1, 2});
label = Label.L_3;
}
77
D.3. PARSE TEST.JAVA