Stellent
HowToComponents
JavaDoc

intradoc.common
Class GrammarElement

java.lang.Object
  |
  +--intradoc.common.GrammarElement

public class GrammarElement
extends java.lang.Object

Holds information about node in the evaluation tree for a grammatical expression.


Field Summary
static int DATE_VAL
          Content type can be parsed into a date.
static int EVAL
          Grammar element type evaluate (substitute from application data).
static int FLOAT_VAL
          Content type can be parsed into a float.
static int FUNCTION
          Grammar element type function call.
static int INTEGER_VAL
          Content type can be parsed into an integer.
static int LITERAL
          Grammar element type literal value.
 java.lang.String m_id
          Name or identifier of element.
 int m_idContentType
          Content type.
 int m_lineCharOffset
          Offset from the beginning of current line in string that was parsed to create this GrammarElement.
 int m_parseLength
          Length of substring that was parsed to create this GrammarElement.
 int m_parseLines
          Number of lines that have been parsed since the beginning of string that was used to create this GrammarElement.
 int m_priority
          If an operator, this is the precedence order.
 GrammarElement[] m_subElementArray
          Used to speed up processing, especially in HPUX.
protected  java.util.Vector m_subElements
          Array of subelements.
 int m_type
          Element type.
 java.lang.String m_uniOperator
          Uni operators (operators with one parameter) do not use the array of sub elements.
 char m_xxOpFirstChar
          First character of operator if element is an operator.
 char m_xxOpSecondChar
          Second character of operator if element is an operator.
static int MULTI
          Grammar element multi-item.
static int OPERATOR
          Grammar element type operator.
static int STRING_VAL
          Content type can only be a string.
 
Constructor Summary
GrammarElement()
          Constructor to apply standard defaults.
GrammarElement(java.lang.String id, int type, int line, int offset, int length)
          Constructor to create an element of a particular type, id, offset, and length.
 
Method Summary
 void appendSubElementStr(java.lang.StringBuffer buf, java.util.Vector subElements, java.lang.String separator)
           
 java.lang.String toString()
          Creates string representation of nested structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EVAL

public static final int EVAL
Grammar element type evaluate (substitute from application data).

See Also:
Constant Field Values

LITERAL

public static final int LITERAL
Grammar element type literal value. Either a number or a string.

See Also:
Constant Field Values

FUNCTION

public static final int FUNCTION
Grammar element type function call.

See Also:
Constant Field Values

OPERATOR

public static final int OPERATOR
Grammar element type operator.

See Also:
Constant Field Values

MULTI

public static final int MULTI
Grammar element multi-item. The grammar elements are in the sub items and not at the top level. (This is parsed from a comma separated list which is not inside of a function parameter list, if it were a function parameter list then this type should be 'FUNCTION'). Note: a multi element leaves most of the attributes in this class unset (such as m_id, or m_parseLines, etc.)

See Also:
Constant Field Values

STRING_VAL

public static final int STRING_VAL
Content type can only be a string.

See Also:
Constant Field Values

INTEGER_VAL

public static final int INTEGER_VAL
Content type can be parsed into an integer.

See Also:
Constant Field Values

FLOAT_VAL

public static final int FLOAT_VAL
Content type can be parsed into a float.

See Also:
Constant Field Values

DATE_VAL

public static final int DATE_VAL
Content type can be parsed into a date.

See Also:
Constant Field Values

m_id

public java.lang.String m_id
Name or identifier of element. If element is variable being substituted then id is variable name. If function being executed, then contains function name. If operator, then it contains string representation for operator.


m_type

public int m_type
Element type. Used to determine how element should be evaluated.


m_idContentType

public int m_idContentType
Content type. If GrammarElement is a literal, then this attribute indicates what type of literal (string, integer, float, or date).


m_priority

public int m_priority
If an operator, this is the precedence order. A lower priority operator is executed first.


m_subElements

protected java.util.Vector m_subElements
Array of subelements. If doing EVAL then does string union of results. If function or operator then array is operands.


m_subElementArray

public GrammarElement[] m_subElementArray
Used to speed up processing, especially in HPUX. Arrays aren't synchronized so no contention occurs for the objects, as opposed to Vectors.


m_uniOperator

public java.lang.String m_uniOperator
Uni operators (operators with one parameter) do not use the array of sub elements. Instead, the uni operator to apply to this element after it has been evaluated is put here.


m_parseLines

public int m_parseLines
Number of lines that have been parsed since the beginning of string that was used to create this GrammarElement. Used for error reporting.


m_lineCharOffset

public int m_lineCharOffset
Offset from the beginning of current line in string that was parsed to create this GrammarElement. Used for error reporting.


m_parseLength

public int m_parseLength
Length of substring that was parsed to create this GrammarElement. Used for debugging.


m_xxOpFirstChar

public char m_xxOpFirstChar
First character of operator if element is an operator. Attributes with 'xx' prefix are present to optimize speed of execution.


m_xxOpSecondChar

public char m_xxOpSecondChar
Second character of operator if element is an operator. Equals zero if operator has only one character.

Constructor Detail

GrammarElement

public GrammarElement()
Constructor to apply standard defaults.


GrammarElement

public GrammarElement(java.lang.String id,
                      int type,
                      int line,
                      int offset,
                      int length)
Constructor to create an element of a particular type, id, offset, and length.

Method Detail

toString

public java.lang.String toString()
Creates string representation of nested structure.

Overrides:
toString in class java.lang.Object

appendSubElementStr

public void appendSubElementStr(java.lang.StringBuffer buf,
                                java.util.Vector subElements,
                                java.lang.String separator)


(c) 1996-2005  All rights reserved.  Stellent, Inc.