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

Class: PHP_ParserGenerator_Config

Source Location: /ParserGenerator/Config.php

Class PHP_ParserGenerator_Config

Class Overview

a mark (dot) showing how much of that rule has been processed so far.

Configurations also contain a follow-set which is a list of terminal symbols which are allowed to immediately follow the end of the rule. Every configuration is recorded as an instance of the following class.

Located in /ParserGenerator/Config.php [line 63]



		
				Author(s):
		
		
		
Information Tags:
Since:  Class available since Release 0.1.0
Version:  @package_version@
License:  New BSD License
Copyright:  2006 Gregory Beaver

Properties

Methods

[ Top ]
Property Summary
static PHP_ParserGenerator_Config   $basis   Top of the list of basis configurations for the current state.
static PHP_ParserGenerator_Config   $basisend   Last on the list of basis configurations for the current state.
static PHP_ParserGenerator_Config   $current   Top of the list of configurations for the current state.
static PHP_ParserGenerator_Config   $currentend   Last on the list of configurations for the current state.
static array   $x4a   Associative array representation of the linked list of configurations found in $current
int   $bp   Index of the next basis configuration PHP_ParserGenerator_Config object
PHP_ParserGenerator_PropagationLink   $bplp   Follow-set backwards propagation links
int   $dot   The parse point.
PHP_ParserGenerator_PropagationLink   $fplp   Follow-set forward propagation links.
array   $fws   Follow-set for this configuration only
int   $next   Next configuration in the state.
PHP_ParserGenerator_Rule   $rp   The parser rule upon with the configuration is based.
int   $status   Status during followset and shift computations.
PHP_ParserGenerator_State   $stp   State that contains this configuration

[ Top ]
Method Summary
static unknown   Configcmp()   Compare two configurations for sorting purposes.
static PHP_ParserGenerator_Config   Configlist_add()   Add another configuration to the configuration list for this parser state.
static PHP_ParserGenerator_Config   Configlist_addbasis()   Add a basis configuration to the configuration list for this parser state.
static PHP_ParserGenerator_Config   Configlist_basis()   Return a pointer to the head of the basis list and
static void   Configlist_closure()   Compute the closure of the configuration list.
static void   Configlist_eat()   Free all elements of the given configuration list
static void   Configlist_init()   Initialize the configuration list builder for a new state.
static void   Configlist_reset()   Reset the configuration list builder for a new state.
static PHP_ParserGenerator_Config   Configlist_return()   Return a pointer to the head of the configuration list and
static void   Configlist_sort()   Sort the configuration list
static void   Configlist_sortbasis()   Sort the configuration list
static void   Configshow()   Display the current configuration for the .out file
static void   Configtable_clear()   Remove all data from the associative array representation of configurations.
static PHP_ParserGenerator_Config|0   Configtable_find()   Return a pointer to data assigned to the given key. Return NULL if no such key.
static void   Configtable_insert()   Insert a new record into the array. Return TRUE if successful.
static void   Configtable_reset()   Remove all data from the table.
void   ConfigPrint()   Print out information on this configuration.

[ Top ]
Properties
static PHP_ParserGenerator_Config   $basis [line 160]

Top of the list of basis configurations for the current state.

API Tags:
Access:  public


[ Top ]
static PHP_ParserGenerator_Config   $basisend [line 165]

Last on the list of basis configurations for the current state.

API Tags:
Access:  public


[ Top ]
static PHP_ParserGenerator_Config   $current [line 149]

Top of the list of configurations for the current state.

API Tags:
Access:  public


[ Top ]
static PHP_ParserGenerator_Config   $currentend [line 154]

Last on the list of configurations for the current state.

API Tags:
Access:  public


[ Top ]
static array   $x4a = array() [line 173]

Associative array representation of the linked list of configurations found in $current

API Tags:
Access:  public


[ Top ]
int   $bp [line 143]

Index of the next basis configuration PHP_ParserGenerator_Config object

API Tags:
Access:  public


[ Top ]

Follow-set backwards propagation links

API Tags:
Access:  public


[ Top ]
int   $dot [line 96]

The parse point.

This is the index into the right-hand side of a rule that is represented by this configuration. In other words, possible dots for this rule:

 blah ::= FOO bar.

are (represented by "[here]"):

 blah ::= [here] FOO bar.
 blah ::= FOO [here] bar.
 blah ::= FOO bar [here].

API Tags:
Access:  public


[ Top ]

Follow-set forward propagation links.

API Tags:
Access:  public


[ Top ]
array   $fws [line 104]

Follow-set for this configuration only

This is the list of terminals and non-terminals that can follow this configuration.

API Tags:
Access:  public


[ Top ]
int   $next [line 138]

Next configuration in the state.

Index of next PHP_ParserGenerator_Config object.

API Tags:
Access:  public


[ Top ]
PHP_ParserGenerator_Rule   $rp [line 75]

The parser rule upon with the configuration is based.

A parser rule is something like:

 blah ::= FOO bar.

API Tags:
Access:  public


[ Top ]
int   $status [line 131]

Status during followset and shift computations.

One of PHP_ParserGenerator_Config::COMPLETE or PHP_ParserGenerator_Config::INCOMPLETE.

API Tags:
Access:  public


[ Top ]
PHP_ParserGenerator_State   $stp [line 119]

State that contains this configuration

API Tags:
Access:  public


[ Top ]
Methods
static method Configcmp  [line 470]

  static unknown Configcmp( unknown_type $a, unknown_type $b  )

Compare two configurations for sorting purposes.

Configurations based on higher precedence rules (those earlier in the file) are chosen first. Two configurations that are the same rule are sorted by dot (see $dot), and those configurations with a dot closer to the left-hand side are chosen first.

Parameters:
unknown_type   $a: 
unknown_type   $b: 

API Tags:
Usedby:  PHP_ParserGenerator_Config::Configlist_sort()
Usedby:  PHP_ParserGenerator_Config::Configlist_sortbasis()


[ Top ]
static method Configlist_add  [line 278]

  static PHP_ParserGenerator_Config Configlist_add( PHP_ParserGenerator_Rule $rp, int $dot  )

Add another configuration to the configuration list for this parser state.

Parameters:
PHP_ParserGenerator_Rule   $rp:  the rule
int   $dot:  Index into the right-hand side of the rule where the dot goes


[ Top ]
static method Configlist_addbasis  [line 310]

  static PHP_ParserGenerator_Config Configlist_addbasis( PHP_ParserGenerator_Rule $rp, int $dot  )

Add a basis configuration to the configuration list for this parser state.

Basis configurations are the root for a configuration. This method also inserts the configuration into the regular list of configurations for this reason.

Parameters:
PHP_ParserGenerator_Rule   $rp:  the rule
int   $dot:  Index into the right-hand side of the rule where the dot goes


[ Top ]
static method Configlist_basis  [line 430]

  static PHP_ParserGenerator_Config Configlist_basis( )

Return a pointer to the head of the basis list and

reset the list


API Tags:
See:  PHP_ParserGenerator_Config::$basis


[ Top ]
static method Configlist_closure  [line 341]

  static void Configlist_closure( PHP_ParserGenerator_Data $lemp  )

Compute the closure of the configuration list.

This calculates all of the possible continuations of each configuration, ensuring that each state accounts for every configuration that could arrive at that state.

Parameters:
PHP_ParserGenerator_Data   $lemp: 


[ Top ]
static method Configlist_eat  [line 442]

  static void Configlist_eat( PHP_ParserGenerator_Config $cfp  )

Free all elements of the given configuration list

Parameters:
PHP_ParserGenerator_Config   $cfp: 


[ Top ]
static method Configlist_init  [line 216]

  static void Configlist_init( )

Initialize the configuration list builder for a new state.



[ Top ]
static method Configlist_reset  [line 267]

  static void Configlist_reset( )

Reset the configuration list builder for a new state.


API Tags:
See:  PHP_ParserGenerator_Config::Configtable_clear()


[ Top ]
static method Configlist_return  [line 416]

  static PHP_ParserGenerator_Config Configlist_return( )

Return a pointer to the head of the configuration list and

reset the list


API Tags:
See:  PHP_ParserGenerator_Config::$current


[ Top ]
static method Configlist_sort  [line 388]

  static void Configlist_sort( )

Sort the configuration list


API Tags:
Uses:  PHP_ParserGenerator_Config::Configcmp()


[ Top ]
static method Configlist_sortbasis  [line 402]

  static void Configlist_sortbasis( )

Sort the configuration list


API Tags:
Uses:  PHP_ParserGenerator_Config::Configcmp()


[ Top ]
static method Configshow  [line 190]

  static void Configshow( PHP_ParserGenerator_Config $cfp  )

Display the current configuration for the .out file

Parameters:
PHP_ParserGenerator_Config   $cfp: 

API Tags:
See:  PHP_ParserGenerator_Data::ReportOutput()


[ Top ]
static method Configtable_clear  [line 250]

  static void Configtable_clear( callback|null $f  )

Remove all data from the associative array representation of configurations.

Pass each data to the function $f as it is removed if $f is a valid callback.

Parameters:
callback|null   $f: 


[ Top ]
static method Configtable_find  [line 554]

  static PHP_ParserGenerator_Config|0 Configtable_find( PHP_ParserGenerator_Config $key  )

Return a pointer to data assigned to the given key. Return NULL if no such key.

Parameters:
PHP_ParserGenerator_Config   $key: 


[ Top ]
static method Configtable_insert  [line 520]

  static void Configtable_insert( PHP_ParserGenerator_Config $data  )

Insert a new record into the array. Return TRUE if successful.

Prior data with the same key is NOT overwritten

Parameters:
PHP_ParserGenerator_Config   $data: 


[ Top ]
static method Configtable_reset  [line 233]

  static void Configtable_reset( callback|null $f  )

Remove all data from the table.

Pass each data to the function $f as it is removed if $f is a valid callback.

Parameters:
callback|null   $f: 

API Tags:
See:  PHP_ParserGenerator_Config::Configtable_clear()


[ Top ]
ConfigPrint  [line 485]

  void ConfigPrint( resource $fp  )

Print out information on this configuration.

Parameters:
resource   $fp: 

API Tags:
See:  PHP_ParserGenerator_Data::ReportOutput()


[ Top ]
Constants
COMPLETE = 1 [line 64]

[ Top ]
INCOMPLETE = 2 [line 65]

[ Top ]

Documentation generated on Sun, 02 Jul 2006 09:10:57 -0400 by phpDocumentor 1.3.0