# Class SQLTemplateParser

java.lang.Object
org.apache.cayenne.access.translator.sqltemplate.parser.SQLTemplateParser

All Implemented Interfaces:
  `SQLTemplateParserConstants, SQLTemplateParserTreeConstants`

public class SQLTemplateParser extends Object implements SQLTemplateParserTreeConstants, SQLTemplateParserConstants
Parser of Cayenne Templates.

Since:
  4.1

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `Token`
  `jj_nt`
  Next token.
  `protected JJTSQLTemplateParserState`
  `jjtree`
  `Token`
  `token`
  Current token.
  `SQLTemplateParserTokenManager`
  `token_source`
  Generated Token Manager.

  ### Fields inherited from interface SQLTemplateParserConstants

  `ARGS, COMMA, DEC_DIGITS, DEC_FLT, DEFAULT, DIGIT, DOLLAR, DOT, DOUBLE_QUOTED_STRING, ELSE, END, EOF, ESC, EXPONENT, FALSE, FLOAT_LITERAL, FLT_SUFF, IDENTIFIER, IF, IN_SINGLE_LINE_COMMENT, INT_LITERAL, LBRACKET, LETTER, LSBRACKET, NOT_TEXT, RBRACKET, RSBRACKET, SHARP, SINGLE_LINE_COMMENT_END, SINGLE_QUOTED_STRING, STRING_ESC, TEXT, TEXT_OTHER, tokenImage, TRUE, WithinDoubleQuoteLiteral, WithinSingleQuoteLiteral`

  ### Fields inherited from interface SQLTemplateParserTreeConstants

  `JJTARRAY, JJTBLOCK, JJTBOOLSCALAR, JJTDIRECTIVE, JJTEXPRESSION, JJTFLOATSCALAR, JJTIFELSE, JJTINTSCALAR, JJTMETHOD, jjtNodeName, JJTSTRINGSCALAR, JJTTEXT, JJTVARIABLE, JJTVOID`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SQLTemplateParser(InputStream stream)`
  Constructor with InputStream.
  `SQLTemplateParser(InputStream stream, String encoding)`
  Constructor with InputStream and supplied encoding
  `SQLTemplateParser(Reader stream)`
  Constructor.
  `SQLTemplateParser(SQLTemplateParserTokenManager tm)`
  Constructor with generated Token Manager.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `array()`
  `final void`
  `block()`
  `final void`
  `directive()`
  `final void`
  `disable_tracing()`
  Disable tracing.
  `final void`
  `enable_tracing()`
  Enable tracing.
  `final void`
  `expression()`
  `ParseException`
  `generateParseException()`
  Generate ParseException.
  `final Token`
  `getNextToken()`
  Get the next Token.
  `final Token`
  `getToken(int index)`
  Get the specific Token.
  `final void`
  `ifElse()`
  `final void`
  `method()`
  `void`
  `ReInit(InputStream stream)`
  Reinitialise.
  `void`
  `ReInit(InputStream stream, String encoding)`
  Reinitialise.
  `void`
  `ReInit(Reader stream)`
  Reinitialise.
  `void`
  `ReInit(SQLTemplateParserTokenManager tm)`
  Reinitialise.
  `final void`
  `scalar()`
  `final Node`
  `template()`
  `final void`
  `text()`
  `final boolean`
  `trace_enabled()`
  Trace enabled.
  `final void`
  `variable()`

  ### Methods inherited from class Object

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

- ## Field Details

  - ### jjtree

    protected JJTSQLTemplateParserState jjtree

  - ### token_source

    public SQLTemplateParserTokenManager token_source
    Generated Token Manager.

  - ### token

    public Token token
    Current token.

  - ### jj_nt

    public Token jj_nt
    Next token.

- ## Constructor Details

  - ### SQLTemplateParser

    public SQLTemplateParser(InputStream stream)
    Constructor with InputStream.

  - ### SQLTemplateParser

    public SQLTemplateParser(InputStream stream, String encoding)
    Constructor with InputStream and supplied encoding

  - ### SQLTemplateParser

    public SQLTemplateParser(Reader stream)
    Constructor.

  - ### SQLTemplateParser

    public SQLTemplateParser(SQLTemplateParserTokenManager tm)
    Constructor with generated Token Manager.

- ## Method Details

  - ### template

    public final Node template() throws ParseException
    Throws:
      `ParseException`

  - ### block

    public final void block() throws ParseException
    Throws:
      `ParseException`

  - ### text

    public final void text() throws ParseException
    Throws:
      `ParseException`

  - ### ifElse

    public final void ifElse() throws ParseException
    Throws:
      `ParseException`

  - ### directive

    public final void directive() throws ParseException
    Throws:
      `ParseException`

  - ### expression

    public final void expression() throws ParseException
    Throws:
      `ParseException`

  - ### scalar

    public final void scalar() throws ParseException
    Throws:
      `ParseException`

  - ### variable

    public final void variable() throws ParseException
    Throws:
      `ParseException`

  - ### method

    public final void method() throws ParseException
    Throws:
      `ParseException`

  - ### array

    public final void array() throws ParseException
    Throws:
      `ParseException`

  - ### ReInit

    public void ReInit(InputStream stream)
    Reinitialise.

  - ### ReInit

    public void ReInit(InputStream stream, String encoding)
    Reinitialise.

  - ### ReInit

    public void ReInit(Reader stream)
    Reinitialise.

  - ### ReInit

    public void ReInit(SQLTemplateParserTokenManager tm)
    Reinitialise.

  - ### getNextToken

    public final Token getNextToken()
    Get the next Token.

  - ### getToken

    public final Token getToken(int index)
    Get the specific Token.

  - ### generateParseException

    public ParseException generateParseException()
    Generate ParseException.

  - ### trace_enabled

    public final boolean trace_enabled()
    Trace enabled.

  - ### enable_tracing

    public final void enable_tracing()
    Enable tracing.

  - ### disable_tracing

    public final void disable_tracing()
    Disable tracing.