Lines Matching refs:out

227   protected static void emit_package(PrintStream out)  in emit_package()  argument
231 out.println("package " + package_name + ";\n"); in emit_package()
242 public static void symbols(PrintStream out, boolean emit_non_terms) in symbols() argument
250 out.println(); in symbols()
251 out.println("//----------------------------------------------------"); in symbols()
252 out.println("// The following code was generated by " + in symbols()
254 out.println("// " + new Date()); in symbols()
255 out.println("//----------------------------------------------------"); in symbols()
256 out.println(); in symbols()
257 emit_package(out); in symbols()
260 out.println( in symbols()
262 out.println("public class " + symbol_const_class_name + " {"); in symbols()
264 out.println(" /* terminals */"); in symbols()
272 out.println(" static final int " + term.name() + " = " + in symbols()
279 out.println("\n /* non terminals */"); in symbols()
287 out.println(" static final int " + nt.name() + " = " + in symbols()
293 out.println("};\n"); in symbols()
304 protected static void emit_action_code(PrintStream out, production start_prod) in emit_action_code() argument
312 out.println(); in emit_action_code()
313 out.println( in emit_action_code()
316 out.println("class " + pre("actions") + " {"); in emit_action_code()
321 out.println(); in emit_action_code()
322 out.println(action_code); in emit_action_code()
326 out.println(); in emit_action_code()
327 out.println(" /** Constructor */"); in emit_action_code()
328 out.println(" " + pre("actions") + "() { }"); in emit_action_code()
331 out.println(); in emit_action_code()
332 out.println(" /** Method with the actual generated action code. */"); in emit_action_code()
333 out.println(" public final java_cup.runtime.symbol " + in emit_action_code()
335 out.println(" int " + pre("act_num,")); in emit_action_code()
336 out.println(" java_cup.runtime.lr_parser " + pre("parser,")); in emit_action_code()
337 out.println(" java.util.Stack " + pre("stack,")); in emit_action_code()
338 out.println(" int " + pre("top)")); in emit_action_code()
339 out.println(" throws java.lang.Exception"); in emit_action_code()
340 out.println(" {"); in emit_action_code()
343 out.println(" /* object for return from actions */"); in emit_action_code()
344 out.println(" java_cup.runtime.symbol " + pre("result") + ";"); in emit_action_code()
345 out.println(); in emit_action_code()
348 out.println(" /* select the action based on the action number */"); in emit_action_code()
349 out.println(" switch (" + pre("act_num") + ")"); in emit_action_code()
350 out.println(" {"); in emit_action_code()
358 out.println(" /*. . . . . . . . . . . . . . . . . . . .*/"); in emit_action_code()
359 out.println(" case " + prod.index() + ": // " + in emit_action_code()
363 out.println(" {"); in emit_action_code()
367 out.println(" " +debug_grammar+ "(\"" + in emit_action_code()
371 out.println(" " + pre("result") + " = new " + in emit_action_code()
379 out.println(" " + prod.action().code_string()); in emit_action_code()
382 out.println(" }"); in emit_action_code()
387 out.println(" /* ACCEPT */"); in emit_action_code()
388 out.println(" " + pre("parser") + ".done_parsing();"); in emit_action_code()
392 out.println(" return " + pre("result") + ";"); in emit_action_code()
393 out.println(); in emit_action_code()
397 out.println(" /* . . . . . .*/"); in emit_action_code()
398 out.println(" default:"); in emit_action_code()
399 out.println(" throw new Exception("); in emit_action_code()
400 out.println(" \"Invalid action number found in " + in emit_action_code()
402 out.println(); in emit_action_code()
403 out.println(" }"); in emit_action_code()
406 out.println(" }"); in emit_action_code()
409 out.println("};\n"); in emit_action_code()
419 protected static void emit_production_table(PrintStream out) in emit_production_table() argument
427 out.println(); in emit_production_table()
428 out.println(" /** production table */"); in emit_production_table()
429 out.println(" protected static final short _production_table[][] = {"); in emit_production_table()
440 out.print(" "); in emit_production_table()
446 out.print(" {"); in emit_production_table()
447 out.print(/* lhs symbol # */ prod.lhs().the_symbol().index() + ", "); in emit_production_table()
448 out.print(/* rhs size */ prod.rhs_length() + "}"); in emit_production_table()
451 if (i < production.number()-1) out.print(", "); in emit_production_table()
456 out.println(); in emit_production_table()
457 out.print(" "); in emit_production_table()
462 out.println(" };"); in emit_production_table()
465 out.println(); in emit_production_table()
466 out.println(" /** access to production table */"); in emit_production_table()
467 out.println(" public short[][] production_table() " + in emit_production_table()
481 PrintStream out, in do_action_table() argument
492 out.println(); in do_action_table()
493 out.println(" /** parse action table */"); in do_action_table()
494 out.println(" protected static final short[][] _action_table = {"); in do_action_table()
508 out.print(" /*" + i + "*/{"); in do_action_table()
524 out.print(j + "," + in do_action_table()
534 out.print(j + "," + (-(red+1)) + ","); in do_action_table()
546 out.println("-1," + (-(row.default_reduce+1)) + "},"); in do_action_table()
548 out.println("-1,0},"); in do_action_table()
552 out.println(" };"); in do_action_table()
555 out.println(); in do_action_table()
556 out.println(" /** access to parse action table */"); in do_action_table()
557 out.println(" public short[][] action_table() {return _action_table;}"); in do_action_table()
569 PrintStream out, in do_reduce_table() argument
577 out.println(); in do_reduce_table()
578 out.println(" /** reduce_goto table */"); in do_reduce_table()
579 out.println(" protected static final short[][] _reduce_table = {"); in do_reduce_table()
584 out.print(" /*" + i + "*/{"); in do_reduce_table()
596 out.print(j + "," + goto_st.index() + ","); in do_reduce_table()
601 out.println("-1,-1},"); in do_reduce_table()
605 out.println(" };"); in do_reduce_table()
608 out.println(); in do_reduce_table()
609 out.println(" /** access to reduce_goto table */"); in do_reduce_table()
610 out.println(" public short[][] reduce_table() {return _reduce_table;}"); in do_reduce_table()
611 out.println(); in do_reduce_table()
627 PrintStream out, in parser() argument
638 out.println(); in parser()
639 out.println("//----------------------------------------------------"); in parser()
640 out.println("// The following code was generated by " + in parser()
642 out.println("// " + new Date()); in parser()
643 out.println("//----------------------------------------------------"); in parser()
644 out.println(); in parser()
645 emit_package(out); in parser()
649 out.println("import " + import_list.elementAt(i) + ";"); in parser()
652 out.println(); in parser()
653 out.println("public class " + parser_class_name + in parser()
657 out.println(); in parser()
658 out.println(" /** constructor */"); in parser()
659 out.println(" public " + parser_class_name + "() {super();}"); in parser()
662 emit_production_table(out); in parser()
663 do_action_table(out, action_table, compact_reduces); in parser()
664 do_reduce_table(out, reduce_table); in parser()
667 out.println(" /** instance of action encapsulation class */"); in parser()
668 out.println(" protected " + pre("actions") + " action_obj;"); in parser()
669 out.println(); in parser()
672 out.println(" /** action encapsulation object initializer */"); in parser()
673 out.println(" protected void init_actions()"); in parser()
674 out.println(" {"); in parser()
675 out.println(" action_obj = new " + pre("actions") + "();"); in parser()
676 out.println(" }"); in parser()
677 out.println(); in parser()
680 out.println(" /** invoke a user supplied parse action */"); in parser()
681 out.println(" public java_cup.runtime.symbol do_action("); in parser()
682 out.println(" int act_num,"); in parser()
683 out.println(" java_cup.runtime.lr_parser parser,"); in parser()
684 out.println(" java.util.Stack stack,"); in parser()
685 out.println(" int top)"); in parser()
686 out.println(" throws java.lang.Exception"); in parser()
687 out.println(" {"); in parser()
688 out.println(" /* call code in generated class */"); in parser()
689 out.println(" return action_obj." + pre("do_action(") + in parser()
691 out.println(" }"); in parser()
692 out.println(""); in parser()
696 out.println(" /** start state */"); in parser()
697 out.println(" public int start_state() {return " + start_st + ";}"); in parser()
700 out.println(" /** start production */"); in parser()
701 out.println(" public int start_production() {return " + in parser()
703 out.println(); in parser()
706 out.println(" /** EOF symbol index */"); in parser()
707 out.println(" public int EOF_sym() {return " + terminal.EOF.index() + in parser()
709 out.println(); in parser()
710 out.println(" /** error symbol index */"); in parser()
711 out.println(" public int error_sym() {return " + terminal.error.index() + in parser()
713 out.println(); in parser()
718 out.println(); in parser()
719 out.println(" /** user initialization */"); in parser()
720 out.println(" public void user_init() throws java.lang.Exception"); in parser()
721 out.println(" {"); in parser()
722 out.println(init_code); in parser()
723 out.println(" }"); in parser()
729 out.println(); in parser()
730 out.println(" /** scan to get the next token */"); in parser()
731 out.println(" public java_cup.runtime.token scan()"); in parser()
732 out.println(" throws java.lang.Exception"); in parser()
733 out.println(" {"); in parser()
734 out.println(scan_code); in parser()
735 out.println(" }"); in parser()
741 out.println(); in parser()
742 out.println(parser_code); in parser()
746 out.println("};"); in parser()
749 emit_action_code(out, start_prod); in parser()