Class Tdom2format

java.lang.Object
eu.bandm.tools.formattext.Tdom2format

@PropertyDependency("eu.bandm.tools.formatfrontends.lineWidth") @PropertyDependency("eu.bandm.tools.formatfrontends.targetClassPath") public class Tdom2format extends Object
Application to translate a format description for elements of a tdom model into format-generating code.
  • Field Details

    • tt_identifier

      protected static final TokenType tt_identifier
    • tt_dollar

      protected static final TokenType tt_dollar
      Stand-alone dollar sign is needed for "element$number".
    • tt_pcdata

      protected static final TokenType tt_pcdata
    • tt_S

      protected static final TokenType tt_S
    • tt_Seq

      protected static final TokenType tt_Seq
    • tt_C

      protected static final TokenType tt_C
    • tt_Choice

      protected static final TokenType tt_Choice
    • tt_A

      protected static final TokenType tt_A
    • tt_Alt

      protected static final TokenType tt_Alt
    • tt_equals

      protected static final TokenType tt_equals
    • tt_stop

      protected static final TokenType tt_stop
    • tt_comment

      protected static final TokenType tt_comment
    • rules

      protected static Set<TokenRule<TokenType>> rules
  • Method Details

    • main

      public static void main(String[] args)
      CLI tool for converting a list of format text rules into a Java source text of a single visitor class. That class will implement toFormat() methods, which realize the rules in the input.

      Two file formats are supported as input: A list of rules, or a DTD with process instructions containing rules.

      The syntax of all rules is FIXME MORE

      Parameters:
      args - command line arguments are
               0: root of source tree
               1: package name
               2: name of base visitor class
               3: name of class to generate
               4: indication of source type "dtd" to select dtd input mode,
                    or any other string for rule-file input
               5: position of the file with the sequence of rules,
                    or of a dtd file with PIs like
                    "<?tdom2format nt=xxx. nt $C1 $A2 =yyy.>"