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

Class: PHP_ParserGenerator_Config

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

Class Overview


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


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2006 Gregory Beaver

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 66]
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.



[ Top ]


Class Variables

$basis =

[line 164]

Top of the list of basis configurations for the current state.
  • Access: public



[ Top ]

$basisend =

[line 169]

Last on the list of basis configurations for the current state.
  • Access: public



[ Top ]

$bp =

[line 147]

Index of the next basis configuration PHP_ParserGenerator_Config object
  • Access: public

Type:   int


[ Top ]

$bplp =

[line 118]

Follow-set backwards propagation links
  • Access: public



[ Top ]

$current =

[line 153]

Top of the list of configurations for the current state.
  • Access: public



[ Top ]

$currentend =

[line 158]

Last on the list of configurations for the current state.
  • Access: public



[ Top ]

$dot =

[line 100]

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

  • Access: public

Type:   int


[ Top ]

$fplp =

[line 113]

Follow-set forward propagation links.
  • Access: public



[ Top ]

$fws =

[line 108]

Follow-set for this configuration only

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

  • Access: public

Type:   array


[ Top ]

$next =

[line 142]

Next configuration in the state.

Index of next PHP_ParserGenerator_Config object.

  • Access: public

Type:   int


[ Top ]

$rp =

[line 79]

The parser rule upon with the configuration is based.

A parser rule is something like:

 blah ::= FOO bar.

  • Access: public



[ Top ]

$status =

[line 135]

Status during followset and shift computations.

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

  • Access: public

Type:   int


[ Top ]

$stp =

[line 123]

State that contains this configuration
  • Access: public



[ Top ]

$x4a = array()

[line 177]

Associative array representation of the linked list of configurations found in $current
  • Access: public

Type:   array


[ Top ]



Method Detail

Configcmp   [line 474]

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     

[ Top ]

Configlist_add   [line 282]

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 ]

Configlist_addbasis   [line 314]

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 ]

Configlist_basis   [line 434]

PHP_ParserGenerator_Config Configlist_basis( )

Return a pointer to the head of the basis list and

reset the list


[ Top ]

Configlist_closure   [line 345]

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 ]

Configlist_eat   [line 446]

void Configlist_eat( PHP_ParserGenerator_Config $cfp)

Free all elements of the given configuration list

Parameters:

PHP_ParserGenerator_Config   $cfp     

[ Top ]

Configlist_init   [line 220]

void Configlist_init( )

Initialize the configuration list builder for a new state.

[ Top ]

Configlist_reset   [line 271]

void Configlist_reset( )

Reset the configuration list builder for a new state.

[ Top ]

Configlist_return   [line 420]

PHP_ParserGenerator_Config Configlist_return( )

Return a pointer to the head of the configuration list and

reset the list


[ Top ]

Configlist_sort   [line 392]

void Configlist_sort( )

Sort the configuration list

[ Top ]

Configlist_sortbasis   [line 406]

void Configlist_sortbasis( )

Sort the configuration list

[ Top ]

ConfigPrint   [line 489]

void ConfigPrint( resource $fp)

Print out information on this configuration.

Parameters:

resource   $fp     

[ Top ]

Configshow   [line 194]

void Configshow( PHP_ParserGenerator_Config $cfp)

Display the current configuration for the .out file

Parameters:

PHP_ParserGenerator_Config   $cfp     

[ Top ]

Configtable_clear   [line 254]

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 ]

Configtable_find   [line 558]

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 ]

Configtable_insert   [line 524]

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 ]

Configtable_reset   [line 237]

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     

[ Top ]


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