PHP Objects, Patterns and Practice (3rd edition)

(Barry) #1
■ INDEX

programming to, 108
representing in UML, 111
interpret(), 191, 193–194, 485
Interpreter pattern
add(), 478
BooleanAndExpression class, 195
BooleanOrExpression class, 195
building a tree of Parser objects, 474
char_no(), 473
CharacterParse class, code listing, 477
class diagram, 197
CollectionParse class, code listing, 477
compile(), 484
composite (collection) parsers, 476
composite parsers and EBNF notation, 482
Context class, code listing, 472
discard(), 476
doInterpret(), 194
doScan(), 476–478
eatWhiteSpace(), 477
EqualsExpression class, 195
evaluate(), 484–485
Expression class, 191
expression(), 484
Extended Backus-Naur Form (EBNF), 191
getKey(), 192–194
getState(), 472
getting from a parse tree to an interpreter,
485
getTypeString(), 473
handleMatch(), 476, 485
internals for invoking, 196
interpret(), 191, 193–194, 485
Interpreter classes, class diagram, 191
InterpreterContext class, 191, 193
invokeHandler(), 476
isSpaceChar(), 472
isWordChar(), 472
lack of a parser in, 467
MarkLogic grammar elements, table of, 190
MarkLogic interpreter, 467
MarkParse class, code listing, 482
Metsker, Steven, 467
minilanguages, 189–190
next(), 477
nextToken(), 472–473, 477


offering users a Domain Specific Language
(DSL), 189
OperatorExpression class, 194
overview of, 189
Parser class, code listing, 474
Parser classes, illustration of, 481
parsing a statement, requirements for, 467
push(), 476
Reader interface, code listing, 473
replace(), 193
scan(), 476–478
Scanner class, code listing, 467
ScannerState class, 472
SequenceParse class, code listing, 477
setHandler(), 476, 485
setState(), 472, 478
setValue(), 194
StringReader class, code listing, 473
summary of, 197
term(), 476, 478
terminal parsers, 476
token(), 473
tokens, 467
trigger(), 477–478
variable(), 485
VariableExpression class, code listing, 193
VariableHandler class, 485
InterpreterContext class, 191, 193
invoke(), 96
invokeHandler(), 476
is_a(), 83
is_array(), 393
is_callable(), 67–68, 84
is_subclass_of(), 85
isAbstract(), 90
isError(), 331
isInstantiable(), 90
isPassedByReference(), 94
__isset(), 59
isSpaceChar(), 472
isSubclassOf(), 95
isUserDefined(), 90
isWordChar(), 472
Iterator interface
code listing, 281
table of methods, 280
Free download pdf