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

Class: PHP_ParserGenerator_Config

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

Class Overview


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


Author(s):

Version:

  • 0.1.5

Copyright:

  • 2006 Gregory Beaver

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

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

  • Author: Gregory Beaver <cellog@php.net>
  • Version: 0.1.5
  • Copyright: 2006 Gregory Beaver
  • Since: Class available since Release 0.1.0
  • License: New BSD License


[ Top ]


Class Variables

$basis =

[line 160]

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



[ Top ]

$basisend =

[line 165]

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



[ Top ]

$bp =

[line 143]

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

Type:   int


[ Top ]

$bplp =

[line 114]

Follow-set backwards propagation links
  • Access: public



[ Top ]

$current =

[line 149]

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



[ Top ]

$currentend =

[line 154]

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



[ Top ]

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

  • Access: public

Type:   int


[ Top ]

$fplp =

[line 109]

Follow-set forward propagation links.
  • Access: public



[ Top ]

$fws =

[line 104]

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

Next configuration in the state.

Index of next PHP_ParserGenerator_Config object.

  • Access: public

Type:   int


[ Top ]

$rp =

[line 75]

The parser rule upon with the configuration is based.

A parser rule is something like:

 blah ::= FOO bar.

  • Access: public



[ Top ]

$status =

[line 131]

Status during followset and shift computations.

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

  • Access: public

Type:   int


[ Top ]

$stp =

[line 119]

State that contains this configuration
  • Access: public



[ Top ]

$x4a = array()

[line 173]

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

Type:   array


[ Top ]



Method Detail

Configcmp   [line 470]

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

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

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

PHP_ParserGenerator_Config Configlist_basis( )

Return a pointer to the head of the basis list and

reset the list


[ Top ]

Configlist_closure   [line 341]

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

void Configlist_eat( PHP_ParserGenerator_Config $cfp)

Free all elements of the given configuration list

Parameters:

PHP_ParserGenerator_Config   $cfp   — 

[ Top ]

Configlist_init   [line 216]

void Configlist_init( )

Initialize the configuration list builder for a new state.

[ Top ]

Configlist_reset   [line 267]

void Configlist_reset( )

Reset the configuration list builder for a new state.

[ Top ]

Configlist_return   [line 416]

PHP_ParserGenerator_Config Configlist_return( )

Return a pointer to the head of the configuration list and

reset the list


[ Top ]

Configlist_sort   [line 388]

void Configlist_sort( )

Sort the configuration list

[ Top ]

Configlist_sortbasis   [line 402]

void Configlist_sortbasis( )

Sort the configuration list

[ Top ]

ConfigPrint   [line 485]

void ConfigPrint( resource $fp)

Print out information on this configuration.

Parameters:

resource   $fp   — 

[ Top ]

Configshow   [line 190]

void Configshow( PHP_ParserGenerator_Config $cfp)

Display the current configuration for the .out file

Parameters:

PHP_ParserGenerator_Config   $cfp   — 

[ Top ]

Configtable_clear   [line 250]

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

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

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

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 Thu, 10 Dec 2015 05:43:58 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.