[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/Parsing/Lexer/ -> StateStack.php (summary)

Lexer adapted from Simple Test: http://sourceforge.net/projects/simpletest/ For an intro to the Lexer see: https://web.archive.org/web/20120125041816/http://www.phppatterns.com/docs/develop/simple_test_lexer_notes

Author: Marcus Baker http://www.lastcraft.com
File Size: 61 lines (1 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

StateStack:: (4 methods):
  __construct()
  getCurrent()
  enter()
  leave()


Class: StateStack  - X-Ref

States for a stack machine.

__construct($start)   X-Ref
Constructor. Starts in named state.

param: string $start        Starting state name.

getCurrent()   X-Ref
Accessor for current state.

return: string       State.

enter($state)   X-Ref
Adds a state to the stack and sets it to be the current state.

param: string $state        New state.

leave()   X-Ref
Leaves the current state and reverts
to the previous one.

return: boolean    false if we attempt to drop off the bottom of the list.