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

Class: PHP_ParserGenerator_Parser

Source Location: /PHP_ParserGenerator-0.1.5/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 33]
The grammar parser for lemon grammar files.


[ Top ]


Class Variables

$alias = array()

[line 135]

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

Type:   array


[ Top ]

$declargslot = array()

[line 154]

Where the declaration argument should be put

This is assigned as a reference to an internal variable

  • Access: public

Type:   mixed


[ Top ]

$declassoc =

[line 163]

  • Access: public

Type:   mixed


[ Top ]

$declkeyword =

[line 147]

Keyword of a declaration

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

  • Access: public

Type:   string


[ Top ]

$decllnslot =

[line 161]

Where the declaration linenumber is put

This is assigned as a reference to an internal variable

  • Access: public

Type:   mixed


[ Top ]

$errorcnt =

[line 70]

Number of parsing errors so far
  • Access: public

Type:   int


[ Top ]

$fallback =

[line 110]

The fallback token
  • Access: public



[ Top ]

$filename =

[line 60]

Name of the input file
  • Access: public

Type:   string


[ Top ]

$firstrule =

[line 168]

  • Access: public



[ Top ]

$gp =

[line 80]

Global state vector
  • Access: public



[ Top ]

$lastrule =

[line 172]

  • Access: public



[ Top ]

$lhs =

[line 115]

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



[ Top ]

$lhsalias =

[line 120]

Alias for the LHS
  • Access: public

Type:   string


[ Top ]

$nrhs =

[line 125]

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

Type:   int


[ Top ]

$preccounter =

[line 164]

  • Access: public

Type:   mixed


[ Top ]

$prevrule =

[line 140]

Previous rule parsed
  • Access: public



[ Top ]

$rhs = array()

[line 130]

Right-hand side symbols

Type:   array


[ Top ]

$state =

[line 105]

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 65]

Linenumber at which current token starts
  • Access: public

Type:   int


[ Top ]

$tokenstart =

[line 75]

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

Type:   int


[ Top ]



Method Detail

__construct (Constructor)   [line 179]

PHP_ParserGenerator_Parser __construct( PHP_ParserGenerator $lem)


Parameters:

PHP_ParserGenerator   $lem   — 

[ Top ]

Parse   [line 255]

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 412]

void parseonetoken( string $token)

Parse a single token

Parameters:

string   $token   —  token

[ Top ]


Documentation generated on Thu, 10 Dec 2015 05:43:59 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.