Class FormalArgument

java.lang.Object
org.stringtemplate.v4.compiler.FormalArgument

public class FormalArgument extends Object
Represents the name of a formal argument defined in a template:
  test(a,b,x=defaultvalue) ::= "<a> <n> <x>"
 
Each template has a set of these formal arguments or sets CompiledST.hasFormalArgs to false (indicating that no arguments were specified such as when we create a template with new ST(...)).

Note: originally, I tracked cardinality as well as the name of an attribute. I'm leaving the code here as I suspect something may come of it later. Currently, though, cardinality is not used.

  • Field Details

    • name

      public String name
    • index

      public int index
    • defaultValueToken

      public org.antlr.runtime.Token defaultValueToken
      If they specified default value x=y, store the token here
    • defaultValue

      public Object defaultValue
    • compiledDefaultValue

      public CompiledST compiledDefaultValue
  • Constructor Details

    • FormalArgument

      public FormalArgument(String name)
    • FormalArgument

      public FormalArgument(String name, org.antlr.runtime.Token defaultValueToken)
  • Method Details