Package: erfurt

Class OWLParser





Description
Class Constant Summary
Variable Summary
static mixed $yyExpectedTokens
static mixed $yyFallback
static mixed $yyReduceMap
static mixed $yyRuleInfo
static array $yyRuleName
static array $yyTokenName
static resource|0 $yyTraceFILE
static string|0 $yyTracePrompt
static mixed $yy_action
static mixed $yy_default
static mixed $yy_lookahead
static mixed $yy_reduce_ofst
static mixed $yy_shift_ofst
int $yyerrcnt
int $yyidx
array $yystack
Method Summary
static void PrintTrace ()
static void Trace (resource $TraceFILE, string $zTracePrompt)
static void yy_destructor (int $yymajor, mixed $yypminor)
OWLParser __construct ()
void __destruct ()
void doParse (int $yymajor, mixed $yytokenvalue, mixed 2)
void getStructured ()
void parseString ( $stringToParse)
void printAsTable ()
string tokenName (int $tokenType)
void yy_accept ()
void yy_find_reduce_action (int $stateno, int $iLookAhead)
void yy_find_shift_action (int $iLookAhead)
array yy_get_expected_tokens (int $token)
bool yy_is_expected_token (int $token)
void yy_parse_failed ()
int yy_pop_parser_stack (OWL_To_Erfurt_yyParser 0)
void yy_r0 ()
void yy_r1 ()
void yy_r2 ()
void yy_r3 ()
void yy_r4 ()
void yy_r5 ()
void yy_r6 ()
void yy_r7 ()
void yy_r8 ()
void yy_r9 ()
void yy_r10 ()
void yy_r11 ()
void yy_r12 ()
void yy_r13 ()
void yy_r14 ()
void yy_r15 ()
void yy_r16 ()
void yy_r17 ()
void yy_r18 ()
void yy_r19 ()
void yy_r20 ()
void yy_reduce (int $yyruleno)
void yy_shift (int $yyNewState, int $yyMajor, mixed $yypMinor)
void yy_syntax_error (int $yymajor, mixed $TOKEN)
Variables
static mixed $yyExpectedTokens = array(
/* 0 */ array(1, 11, 13, 18, ),/* 1 */array(1,11,13,18,),/* 2 */array(1,11,13,18,),/* 3 */array(1,11,13,18,),/* 4 */array(1,11,13,18,),/* 5 */array(1,11,13,15,18,),/* 6 */array(1,11,13,18,),/* 7 */array(1,11,13,18,),/* 8 */array(1,11,13,18,),/* 9 */array(1,11,13,18,),/* 10 */array(18,),/* 11 */array(18,),/* 12 */array(15,18,),/* 13 */array(18,),/* 14 */array(4,5,6,7,8,9,10,),/* 15 */array(0,2,3,12,16,19,),/* 16 */array(2,3,12,),/* 17 */array(2,3,19,),/* 18 */array(2,3,),/* 19 */array(16,),/* 20 */array(16,),/* 21 */array(17,),/* 22 */array(17,),/* 23 */array(16,),/* 24 */array(17,),/* 25 */array(14,),/* 26 */array(15,),/* 27 */array(),/* 28 */array(),/* 29 */array(),/* 30 */array(),/* 31 */array(),/* 32 */array(),/* 33 */array(),/* 34 */array(),/* 35 */array(),/* 36 */array(),/* 37 */array(),/* 38 */array(),/* 39 */array(),/* 40 */array(),/* 41 */array(),/* 42 */array(),/* 43 */array(),)
  • access: public
static mixed $yyFallback = array(
)

The next table maps tokens into fallback tokens. If a construct like the following: %fallback ID X Y Z. appears in the grammer, then ID becomes a fallback token for X, Y, and Z. Whenever one of the tokens X, Y, or Z is input to the parser but it does not parse, the type of the token is changed to ID and the parse is retried before an error is thrown.

  • access: public
static mixed $yyReduceMap = array(
0 => 0,
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
7 => 7,
8 => 8,
9 => 9,
10 => 10,
11 => 11,
12 => 12,
13 => 13,
14 => 14,
15 => 15,
16 => 16,
17 => 17,
18 => 18,
21 => 18,
19 => 19,
20 => 20,
)

The following table contains a mapping of reduce action to method name that handles the reduction. If a rule is not set, it has no handler.

  • access: public
static mixed $yyRuleInfo = array(
array( 'lhs' => 21, 'rhs' => 1 ),array('lhs'=>22,'rhs'=>3),array('lhs'=>22,'rhs'=>3),array('lhs'=>22,'rhs'=>5),array('lhs'=>22,'rhs'=>5),array('lhs'=>22,'rhs'=>5),array('lhs'=>22,'rhs'=>3),array('lhs'=>22,'rhs'=>3),array('lhs'=>22,'rhs'=>3),array('lhs'=>22,'rhs'=>2),array('lhs'=>22,'rhs'=>3),array('lhs'=>22,'rhs'=>3),array('lhs'=>22,'rhs'=>3),array('lhs'=>22,'rhs'=>3),array('lhs'=>22,'rhs'=>3),array('lhs'=>22,'rhs'=>1),array('lhs'=>24,'rhs'=>1),array('lhs'=>23,'rhs'=>2),array('lhs'=>23,'rhs'=>1),array('lhs'=>26,'rhs'=>1),array('lhs'=>25,'rhs'=>3),array('lhs'=>25,'rhs'=>1),)

The following table contains information about every rule that is used during the reduce.

 array(
  array(
   int $lhs;         Symbol on the left-hand side of the rule
   int $nrhs;     Number of right-hand side symbols in the rule
  ),...
 );

  • access: public
static array $yyRuleName = array(
/* 0 */ "start ::= classExpr",
/* 1 */ "classExpr ::= LPAREN classExpr RPAREN",
/* 2 */ "classExpr ::= LBRACE enum RBRACE",
/* 3 */ "classExpr ::= propExpr ONLYSOME_OPERATOR LSQUAREBRACKET list RSQUAREBRACKET",
/* 4 */ "classExpr ::= propExpr SOME_OPERATOR LSQUAREBRACKET list RSQUAREBRACKET",
/* 5 */ "classExpr ::= propExpr ONLY_OPERATOR LSQUAREBRACKET list RSQUAREBRACKET",
/* 6 */ "classExpr ::= classExpr AND_OPERATOR classExpr",
/* 7 */ "classExpr ::= classExpr OR_OPERATOR classExpr",
/* 8 */ "classExpr ::= propExpr SOME_OPERATOR classExpr",
/* 9 */ "classExpr ::= NOT_OPERATOR classExpr",
/* 10 */ "classExpr ::= propExpr ONLY_OPERATOR instExpr",
/* 11 */ "classExpr ::= propExpr MIN_OPERATOR NUMERIC",
/* 12 */ "classExpr ::= propExpr MAX_OPERATOR NUMERIC",
/* 13 */ "classExpr ::= propExpr EXACTLY_OPERATOR NUMERIC",
/* 14 */ "classExpr ::= propExpr VALUE_OPERATOR instExpr",
/* 15 */ "classExpr ::= ALPHANUMERIC",
/* 16 */ "propExpr ::= ALPHANUMERIC",
/* 17 */ "enum ::= instExpr enum",
/* 18 */ "enum ::= instExpr",
/* 19 */ "instExpr ::= ALPHANUMERIC",
/* 20 */ "list ::= classExpr COMMA list",
/* 21 */ "list ::= classExpr",
)

For tracing reduce actions, the names of all rules are required.

  • access: public
static array $yyTokenName = array(
'$', 'NOT_OPERATOR', 'AND_OPERATOR', 'OR_OPERATOR',
'MIN_OPERATOR', 'MAX_OPERATOR', 'EXACTLY_OPERATOR', 'VALUE_OPERATOR',
'ONLYSOME_OPERATOR', 'ONLY_OPERATOR', 'SOME_OPERATOR', 'LPAREN',
'RPAREN', 'LBRACE', 'RBRACE', 'LSQUAREBRACKET',
'RSQUAREBRACKET', 'NUMERIC', 'ALPHANUMERIC', 'COMMA',
'error', 'start', 'classExpr', 'enum',
'propExpr', 'list', 'instExpr',
)

For tracing shifts, the names of all terminals and nonterminals are required. The following table supplies these names

  • access: public
static resource|0 $yyTraceFILE
  • access: public
static string|0 $yyTracePrompt

String to prepend to debug output

  • access: public
static mixed $yy_action = array(
/* 0 */ 24, 21, 22, 13, 26, 12, 5, 59, 4, 59,
/* 10 */ 59, 28, 7, 67, 18, 43, 14, 6, 9, 59,
/* 20 */ 42, 7, 8, 59, 10, 17, 59, 14, 40, 15,
/* 30 */ 16, 8, 14, 10, 3, 2, 6, 9, 15, 17,
/* 40 */ 30, 14, 23, 34, 38, 17, 39, 14, 19, 17,
/* 50 */ 1, 14, 20, 36, 51, 35, 11, 14, 31, 37,
/* 60 */ 14, 14, 32, 28, 14, 6, 9, 27, 41, 25,
/* 70 */ 29, 51, 11, 33,
)
  • access: public
static mixed $yy_default = array(
/* 0 */ 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
/* 10 */ 66, 62, 66, 66, 66, 60, 66, 65, 44, 66,
/* 20 */ 66, 66, 66, 66, 66, 66, 66, 56, 63, 57,
/* 30 */ 47, 50, 51, 58, 55, 53, 61, 52, 48, 45,
/* 40 */ 64, 54, 49, 46,
)
  • access: public
static mixed $yy_lookahead = array(
/* 0 */ 4, 5, 6, 7, 8, 9, 10, 0, 15, 2,
/* 10 */ 3, 18, 1, 21, 22, 14, 24, 2, 3, 12,
/* 20 */ 16, 1, 11, 16, 13, 22, 19, 24, 25, 18,
/* 30 */ 22, 11, 24, 13, 19, 15, 2, 3, 18, 22,
/* 40 */ 16, 24, 25, 17, 16, 22, 12, 24, 25, 22,
/* 50 */ 15, 24, 25, 23, 27, 22, 26, 24, 22, 22,
/* 60 */ 24, 24, 22, 18, 24, 2, 3, 17, 26, 23,
/* 70 */ 17, 27, 26, 26,
)
  • access: public
static mixed $yy_reduce_ofst = array(
/* 0 */ -8, 27, 17, 3, 23, 37, 36, 33, 8, 40,
/* 10 */ 46, 30, 42, 47,
)
  • access: public
static mixed $yy_shift_ofst = array(
/* 0 */ 11, 11, 11, 11, 11, 20, 11, 11, 11, 11,
/* 10 */ 45, 45, -7, 45, -4, 7, 34, 15, 63, 4,
/* 20 */ 24, 50, 53, 28, 26, 1, 35,
)
  • access: public
$yyerrcnt
int $yyerrcnt
  • access: public
$yyidx
int $yyidx
  • access: public
$yystack = array()
array $yystack = array()
  • access: public
Methods
static method PrintTrace
void PrintTrace ()

Output debug information to output (php://output stream)

static method Trace
void Trace ( resource $TraceFILE , string $zTracePrompt )

Turn parser tracing on by giving a stream to which to write the trace and a prompt to preface each trace message. Tracing is turned off by making either argument NULL Inputs:

  • A stream resource to which trace output should be written. If NULL, then tracing is turned off.
  • A prefix string written at the beginning of every line of trace output. If NULL, then tracing is turned off.
Outputs:
  • None.

Parameters:
  • resource $TraceFILE
  • string $zTracePrompt
static method yy_destructor
void yy_destructor ( int $yymajor , mixed $yypminor )

The following function deletes the value associated with a symbol. The symbol can be either a terminal or nonterminal.

Parameters:
  • int $yymajor : the symbol code
  • mixed $yypminor : the symbol's value
Constructor __construct
OWLParser __construct ()
Destructor __destruct
void __destruct ()

Deallocate and destroy a parser. Destructors are all called for all stack elements before shutting the parser down.

doParse
void doParse ( int $yymajor , mixed $yytokenvalue , mixed 2 )

The main parser program. The first argument is the major token number. The second is the token value string as scanned from the input.

Parameters:
  • mixed 2 : any extra arguments that should be passed to handlers
  • int $yymajor : the token number
  • mixed $yytokenvalue : the token value
getStructured
void getStructured ()
parseString
void parseString ( $stringToParse )
Parameters:
  • $stringToParse
printAsTable
void printAsTable ()
tokenName
string tokenName ( int $tokenType )

This function returns the symbolic name associated with a token value.

Parameters:
  • int $tokenType
yy_accept
void yy_accept ()

The following is executed when the parser accepts %parse_accept code is inserted here

yy_find_reduce_action
void yy_find_reduce_action ( int $stateno , int $iLookAhead )

Find the appropriate action for a parser given the non-terminal look-ahead token $iLookAhead. If the look-ahead token is self::YYNOCODE, then check to see if the action is independent of the look-ahead. If it is, return the action, otherwise return self::YY_NO_ACTION.

Parameters:
  • int $stateno : Current state number
  • int $iLookAhead : The look-ahead token
yy_find_shift_action
void yy_find_shift_action ( int $iLookAhead )

Find the appropriate action for a parser given the terminal look-ahead token iLookAhead. If the look-ahead token is YYNOCODE, then check to see if the action is independent of the look-ahead. If it is, return the action, otherwise return YY_NO_ACTION.

Parameters:
  • int $iLookAhead : The look-ahead token
yy_get_expected_tokens
array yy_get_expected_tokens ( int $token )

Based on the current state and parser stack, get a list of all possible lookahead tokens

Parameters:
  • int $token
yy_is_expected_token
bool yy_is_expected_token ( int $token )

Based on the parser state and current parser stack, determine whether the lookahead token is possible. The parser will convert the token value to an error token if not. This catches some unusual edge cases where the parser would fail.

Parameters:
  • int $token
yy_parse_failed
void yy_parse_failed ()

The following code executes when the parse fails Code from %parse_fail is inserted here

yy_pop_parser_stack
int yy_pop_parser_stack ( OWL_To_Erfurt_yyParser 0 )

Pop the parser's stack once. If there is a destructor routine associated with the token which is popped from the stack, then call it. Return the major token number for the symbol popped.

Parameters:
  • OWL_To_Erfurt_yyParser 0
yy_r0
void yy_r0 ()
yy_r1
void yy_r1 ()
yy_r2
void yy_r2 ()
yy_r3
void yy_r3 ()
yy_r4
void yy_r4 ()
yy_r5
void yy_r5 ()
yy_r6
void yy_r6 ()
yy_r7
void yy_r7 ()
yy_r8
void yy_r8 ()
yy_r9
void yy_r9 ()
yy_r10
void yy_r10 ()
yy_r11
void yy_r11 ()
yy_r12
void yy_r12 ()
yy_r13
void yy_r13 ()
yy_r14
void yy_r14 ()
yy_r15
void yy_r15 ()
yy_r16
void yy_r16 ()
yy_r17
void yy_r17 ()
yy_r18
void yy_r18 ()
yy_r19
void yy_r19 ()
yy_r20
void yy_r20 ()
yy_reduce
void yy_reduce ( int $yyruleno )

Perform a reduce action and the shift that must immediately follow the reduce. For a rule such as:

 A ::= B blah C. { dosomething(); }
This function will first call the action, if any, ("dosomething();" in our example), and then it will pop three states from the stack, one for each entry on the right-hand side of the expression (B, blah, and C in our example rule), and then push the result of the action back on to the stack with the resulting state reduced to (as described in the .out file)

Parameters:
  • int $yyruleno : Number of the rule by which to reduce
yy_shift
void yy_shift ( int $yyNewState , int $yyMajor , mixed $yypMinor )

Perform a shift action.

Parameters:
  • int $yyNewState : The new state to shift in
  • int $yyMajor : The major token to shift in
  • mixed $yypMinor : the minor token to shift in
yy_syntax_error
void yy_syntax_error ( int $yymajor , mixed $TOKEN )

The following code executes when a syntax error first occurs. %syntax_error code is inserted here

Parameters:
  • int $yymajor : The major type of the error token
  • mixed $TOKEN : The minor type of the error token
Class Constants
ALPHANUMERIC = 18 (line 156)
AND_OPERATOR = 2 (line 140)
COMMA = 19 (line 157)
EXACTLY_OPERATOR = 6 (line 144)
LBRACE = 13 (line 151)
LPAREN = 11 (line 149)
LSQUAREBRACKET = 15 (line 153)
MAX_OPERATOR = 5 (line 143)
MIN_OPERATOR = 4 (line 142)
NOT_OPERATOR = 1 (line 139)
NUMERIC = 17 (line 155)
ONLYSOME_OPERATOR = 8 (line 146)
ONLY_OPERATOR = 9 (line 147)
OR_OPERATOR = 3 (line 141)
RBRACE = 14 (line 152)
RPAREN = 12 (line 150)
RSQUAREBRACKET = 16 (line 154)
SOME_OPERATOR = 10 (line 148)
VALUE_OPERATOR = 7 (line 145)
YYERRORSYMBOL = 20 (line 318)
YYERRSYMDT = 'yy0' (line 319)
YYFALLBACK = 0 (line 320)
YYNOCODE = 28 (line 314)
YYNRULE = 22 (line 317)
YYNSTATE = 44 (line 316)
YYSTACKDEPTH = 100 (line 315)
YY_ACCEPT_ACTION = 67 (line 159)
YY_ERROR_ACTION = 66 (line 160)
YY_NO_ACTION = 68 (line 158)
YY_REDUCE_MAX = 13 (line 241)
YY_REDUCE_USE_DFLT = -9 (line 240)
YY_SHIFT_MAX = 26 (line 234)
YY_SHIFT_USE_DFLT = -8 (line 233)
YY_SZ_ACTTAB = 74 (line 212)

Documentation generated on 2009-01-06 at 01:01 by phpDocumentor 1.4.1