PHP_ParserGenerator
[ class tree: PHP_ParserGenerator ] [ index: PHP_ParserGenerator ] [ all elements ]

Class: PHP_ParserGenerator_Parser

Source Location: /PHP_ParserGenerator-0.1.7/ParserGenerator/Parser.php

Class Overview


The grammar parser for lemon grammar files.


Author(s):

Copyright:

  • 2006 Gregory Beaver

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 36]
The grammar parser for lemon grammar files.


[ Top ]


Class Variables

$alias = array()

[line 138]

Aliases for each RHS symbol name (or NULL)
  • Var: array of strings
  • Access: public

Type:   array


[ Top ]

$declargslot = array()

[line 157]

Where the declaration argument should be put

This is assigned as a reference to an internal variable

  • Access: public

Type:   mixed


[ Top ]

$declassoc =

[line 166]

  • Access: public

Type:   mixed


[ Top ]

$declkeyword =

[line 150]

Keyword of a declaration

This is one of the %keyword keywords in the grammar file

  • Access: public

Type:   string


[ Top ]

$decllnslot =

[line 164]

Where the declaration linenumber is put

This is assigned as a reference to an internal variable

  • Access: public

Type:   mixed


[ Top ]

$errorcnt =

[line 73]

Number of parsing errors so far
  • Access: public

Type:   int


[ Top ]

$fallback =

[line 113]

The fallback token
  • Access: public



[ Top ]

$filename =

[line 63]

Name of the input file
  • Access: public

Type:   string


[ Top ]

$firstrule =

[line 171]

  • Access: public



[ Top ]

$gp =

[line 83]

Global state vector
  • Access: public



[ Top ]

$lastrule =

[line 175]

  • Access: public



[ Top ]

$lhs =

[line 118]

Left-hand side of the current rule
  • Access: public



[ Top ]

$lhsalias =

[line 123]

Alias for the LHS
  • Access: public

Type:   string


[ Top ]

$nrhs =

[line 128]

Number of right-hand side symbols seen
  • Access: public

Type:   int


[ Top ]

$preccounter =

[line 167]

  • Access: public

Type:   mixed


[ Top ]

$prevrule =

[line 143]

Previous rule parsed
  • Access: public



[ Top ]

$rhs = array()

[line 133]

Right-hand side symbols

Type:   array


[ Top ]

$state =

[line 108]

Parser state (one of the class constants for this class)

  • PHP_ParserGenerator_Parser::INITIALIZE,
  • PHP_ParserGenerator_Parser::WAITING_FOR_DECL_OR_RULE,
  • PHP_ParserGenerator_Parser::WAITING_FOR_DECL_KEYWORD,
  • PHP_ParserGenerator_Parser::WAITING_FOR_DECL_ARG,
  • PHP_ParserGenerator_Parser::WAITING_FOR_PRECEDENCE_SYMBOL,
  • PHP_ParserGenerator_Parser::WAITING_FOR_ARROW,
  • PHP_ParserGenerator_Parser::IN_RHS,
  • PHP_ParserGenerator_Parser::LHS_ALIAS_1,
  • PHP_ParserGenerator_Parser::LHS_ALIAS_2,
  • PHP_ParserGenerator_Parser::LHS_ALIAS_3,
  • PHP_ParserGenerator_Parser::RHS_ALIAS_1,
  • PHP_ParserGenerator_Parser::RHS_ALIAS_2,
  • PHP_ParserGenerator_Parser::PRECEDENCE_MARK_1,
  • PHP_ParserGenerator_Parser::PRECEDENCE_MARK_2,
  • PHP_ParserGenerator_Parser::RESYNC_AFTER_RULE_ERROR,
  • PHP_ParserGenerator_Parser::RESYNC_AFTER_DECL_ERROR,
  • PHP_ParserGenerator_Parser::WAITING_FOR_DESTRUCTOR_SYMBOL,
  • PHP_ParserGenerator_Parser::WAITING_FOR_DATATYPE_SYMBOL,
  • PHP_ParserGenerator_Parser::WAITING_FOR_FALLBACK_ID

  • Access: public

Type:   int


[ Top ]

$tokenlineno =

[line 68]

Linenumber at which current token starts
  • Access: public

Type:   int


[ Top ]

$tokenstart =

[line 78]

Index of current token within the input string
  • Access: public

Type:   int


[ Top ]



Method Detail

__construct (Constructor)   [line 182]

PHP_ParserGenerator_Parser __construct( PHP_ParserGenerator $lem)


Parameters:

PHP_ParserGenerator   $lem     

[ Top ]

Parse   [line 258]

void Parse( PHP_ParserGenerator_Data $gp)

In spite of its name, this function is really a scanner.

It reads in the entire input file (all at once) then tokenizes it. Each token is passed to the function "parseonetoken" which builds all the appropriate data structures in the global state vector "gp".


Parameters:

PHP_ParserGenerator_Data   $gp     

[ Top ]

parseonetoken   [line 419]

void parseonetoken( string $token)

Parse a single token

Parameters:

string   $token     token

[ Top ]


Documentation generated on Mon, 25 Oct 2010 14:01:06 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.