ParserRule (API documentation of hlt.language packages)
Date: 2013-01-30

hlt.language.syntax

## Class ParserRule

- java.lang.Object
- - hlt.language.util.Indexed
  - - hlt.language.util.ArrayIndexed
    - - hlt.language.syntax.ParserRule

-     public class ParserRule
      extends ArrayIndexed

  This is the class of production rules used by the parser at parse time. In contrast with a `Grammar`'s `Rule` (the class of production rules used at parser construction time), this doesn't need to store the whole sequence of symbols in the rule's body. At parse time, all that is needed is:
  1. the head symbol (what type of `ParseNode` to push on the parse stack);
  2. the number of symbols in the rule (how far to pop the parse stack).
  Other than that, the actual rule's body is never used by `GenericParser` or its subclasses, nor by the code of `semanticAction` generated by `ParserGenerator`.
  Version:
    Last modified on Fri Apr 13 20:10:39 2012 by hak
  Author:
    Hassan Aït-Kaci
  See Also:
    `Rule`, `ParseNode`, `GenericParser`, `ParserGenerator`
  Copyright:
    © by the author

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `ParserNonTerminal` | `head` The head symbol (the rule's LHS).
    `int` | `length` The number of symbols in the rule's RHS.

    - ### Fields inherited from class hlt.language.util.ArrayIndexed

      `set`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ParserRule(int head, int length, int index, int tagPosition)`
    `ParserRule(int head, int length, int index, int precedence, int associativity)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ParserRule` | `addXmlInfo(int[] children)`
    `ParserRule` | `addXmlInfo(int[][] xmlPaths)`
    `ParserRule` | `addXmlInfo(java.lang.String[] attributeRefs)`
    `ParserRule` | `addXmlInfo(XmlAttributeInfo[] attributes)`
    `ParserRule` | `addXmlInfo(XmlTextInfo[][] infos)`
    `ParserRule` | `addXmlInfo(XmlWrapper[][] wrapperPaths)`
    `ParserRule` | `setXmlInfo(XmlInfo info)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class hlt.language.util.ArrayIndexed

      `equals`

    - ### Methods inherited from class hlt.language.util.Indexed

      `hashCode, index`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### head

          public ParserNonTerminal head

      The head symbol (the rule's LHS).

    - #### length

          public int length

      The number of symbols in the rule's RHS.

  - ### Constructor Detail

    - #### ParserRule

          public ParserRule(int head,
                    int length,
                    int index,
                    int tagPosition)

    - #### ParserRule

          public ParserRule(int head,
                    int length,
                    int index,
                    int precedence,
                    int associativity)

  - ### Method Detail

    - #### setXmlInfo

          public ParserRule setXmlInfo(XmlInfo info)

    - #### addXmlInfo

          public ParserRule addXmlInfo(int[] children)

    - #### addXmlInfo

          public ParserRule addXmlInfo(int[][] xmlPaths)

    - #### addXmlInfo

          public ParserRule addXmlInfo(XmlWrapper[][] wrapperPaths)

    - #### addXmlInfo

          public ParserRule addXmlInfo(java.lang.String[] attributeRefs)

    - #### addXmlInfo

          public ParserRule addXmlInfo(XmlAttributeInfo[] attributes)

    - #### addXmlInfo

          public ParserRule addXmlInfo(XmlTextInfo[][] infos)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `Indexed`