PdeEmitter

processing.mode.java.preproc

## Class PdeEmitter

- Object
- - PdeEmitter

- All Implemented Interfaces:
    PdeTokenTypes

      public class PdeEmitter
      extends Object
      implements PdeTokenTypes

  PDEEmitter: A class that can take an ANTLR Java AST and produce reasonably formatted Java code from it. To use it, create a PDEEmitter object, call setOut() if you want to print to something other than System.out, and then call print(), passing the AST. Typically, the AST node that you pass would be the root of a tree - the ROOT_ID node that represents a Java file. Modified March 2010 to support Java 5 type arguments and for loops by

- - ### Field Summary

    - ### Fields inherited from interface PdeTokenTypes

      `ABSTRACT, ANNOTATION, ANNOTATION_ARRAY_INIT, ANNOTATION_DEF, ANNOTATION_FIELD_DEF, ANNOTATION_MEMBER_VALUE_PAIR, ANNOTATIONS, ARRAY_DECLARATOR, ARRAY_INIT, ASSIGN, AT, BAND, BAND_ASSIGN, BLOCK, BNOT, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, CASE_GROUP, CHAR_LITERAL, CLASS_DEF, COLON, COMMA, CONSTRUCTOR_CAST, CTOR_CALL, CTOR_DEF, DEC, DIV, DIV_ASSIGN, DOT, ELIST, EMPTY_FIELD, EMPTY_STAT, ENUM_CONSTANT_DEF, ENUM_DEF, EOF, EQUAL, ESC, EXPONENT, EXPR, EXTENDS_CLAUSE, FINAL, FLOAT_SUFFIX, FOR_CONDITION, FOR_EACH_CLAUSE, FOR_INIT, FOR_ITERATOR, GE, GT, HEX_DIGIT, IDENT, IMPLEMENTS_CLAUSE, IMPORT, INC, INDEX_OP, INSTANCE_INIT, INTERFACE_DEF, LABELED_STAT, LAND, LBRACK, LCURLY, LE, LITERAL_assert, LITERAL_boolean, LITERAL_break, LITERAL_byte, LITERAL_case, LITERAL_catch, LITERAL_char, LITERAL_class, LITERAL_color, LITERAL_continue, LITERAL_default, LITERAL_do, LITERAL_double, LITERAL_else, LITERAL_enum, LITERAL_extends, LITERAL_false, LITERAL_finally, LITERAL_float, LITERAL_for, LITERAL_if, LITERAL_implements, LITERAL_import, LITERAL_instanceof, LITERAL_int, LITERAL_interface, LITERAL_long, LITERAL_native, LITERAL_new, LITERAL_null, LITERAL_package, LITERAL_private, LITERAL_protected, LITERAL_public, LITERAL_return, LITERAL_short, LITERAL_static, LITERAL_super, LITERAL_switch, LITERAL_synchronized, LITERAL_this, LITERAL_threadsafe, LITERAL_throw, LITERAL_throws, LITERAL_transient, LITERAL_true, LITERAL_try, LITERAL_void, LITERAL_volatile, LITERAL_while, LNOT, LOR, LPAREN, LT, METHOD_CALL, METHOD_DEF, MINUS, MINUS_ASSIGN, ML_COMMENT, MOD, MOD_ASSIGN, MODIFIERS, NOT_EQUAL, NULL_TREE_LOOKAHEAD, NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG, OBJBLOCK, PACKAGE_DEF, PARAMETER_DEF, PARAMETERS, PLUS, PLUS_ASSIGN, POST_DEC, POST_INC, QUESTION, RBRACK, RCURLY, RPAREN, SEMI, SL, SL_ASSIGN, SL_COMMENT, SLIST, SR, SR_ASSIGN, STAR, STAR_ASSIGN, STATIC_IMPORT, STATIC_INIT, STRICTFP, STRING_LITERAL, SUPER_CTOR_CALL, TRIPLE_DOT, TYPE, TYPE_ARGUMENT, TYPE_ARGUMENTS, TYPE_LOWER_BOUNDS, TYPE_PARAMETER, TYPE_PARAMETERS, TYPE_UPPER_BOUNDS, TYPECAST, UNARY_MINUS, UNARY_PLUS, VARIABLE_DEF, VARIABLE_PARAMETER_DEF, VOCAB, WEBCOLOR_LITERAL, WILDCARD_TYPE, WS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PdeEmitter(PdePreprocessor pdePreprocessor, PrintWriter out)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `print(AST ast)` Print the given AST.

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PdeEmitter

          public PdeEmitter(PdePreprocessor pdePreprocessor,
                    PrintWriter out)

  - ### Method Detail

    - #### print

          public void print(AST ast)
                     throws SketchException

      Print the given AST. Call this function to print your PDE code. It works by making recursive calls to print children. So the code below is one big "switch" statement on the passed AST type.
      Throws:
        `SketchException`