/*
php.js 0.1.0
Copyright (c) 2013 Niklas von Hertzen
Released under MIT License
This file contains:
- [var PHP = {Constants:{}};]
- src/modules/tokenizer/constants.js
- src/parser/lexer.js
- src/parser/parser.js
- src/parser/yyn.js
- src/parser/yyn_stmt.js
- src/parser/yyn_expr.js
- src/parser/yyn_scalar.js
*/
define(function(require, exports, module) {
var PHP = {Constants:{}};
PHP.Constants.T_INCLUDE = 257;
PHP.Constants.T_INCLUDE_ONCE = 258;
PHP.Constants.T_EVAL = 259;
PHP.Constants.T_REQUIRE = 260;
PHP.Constants.T_REQUIRE_ONCE = 261;
PHP.Constants.T_LOGICAL_OR = 262;
PHP.Constants.T_LOGICAL_XOR = 263;
PHP.Constants.T_LOGICAL_AND = 264;
PHP.Constants.T_PRINT = 265;
PHP.Constants.T_YIELD = 266;
PHP.Constants.T_DOUBLE_ARROW = 267;
PHP.Constants.T_YIELD_FROM = 268;
PHP.Constants.T_PLUS_EQUAL = 269;
PHP.Constants.T_MINUS_EQUAL = 270;
PHP.Constants.T_MUL_EQUAL = 271;
PHP.Constants.T_DIV_EQUAL = 272;
PHP.Constants.T_CONCAT_EQUAL = 273;
PHP.Constants.T_MOD_EQUAL = 274;
PHP.Constants.T_AND_EQUAL = 275;
PHP.Constants.T_OR_EQUAL = 276;
PHP.Constants.T_XOR_EQUAL = 277;
PHP.Constants.T_SL_EQUAL = 278;
PHP.Constants.T_SR_EQUAL = 279;
PHP.Constants.T_POW_EQUAL = 280;
PHP.Constants.T_COALESCE = 281;
PHP.Constants.T_BOOLEAN_OR = 282;
PHP.Constants.T_BOOLEAN_AND = 283;
PHP.Constants.T_IS_EQUAL = 284;
PHP.Constants.T_IS_NOT_EQUAL = 285;
PHP.Constants.T_IS_IDENTICAL = 286;
PHP.Constants.T_IS_NOT_IDENTICAL = 287;
PHP.Constants.T_SPACESHIP = 288;
PHP.Constants.T_IS_SMALLER_OR_EQUAL = 289;
PHP.Constants.T_IS_GREATER_OR_EQUAL = 290;
PHP.Constants.T_SL = 291;
PHP.Constants.T_SR = 292;
PHP.Constants.T_INSTANCEOF = 293;
PHP.Constants.T_INC = 294;
PHP.Constants.T_DEC = 295;
PHP.Constants.T_INT_CAST = 296;
PHP.Constants.T_DOUBLE_CAST = 297;
PHP.Constants.T_STRING_CAST = 298;
PHP.Constants.T_ARRAY_CAST = 299;
PHP.Constants.T_OBJECT_CAST = 300;
PHP.Constants.T_BOOL_CAST = 301;
PHP.Constants.T_UNSET_CAST = 302;
PHP.Constants.T_POW = 303;
PHP.Constants.T_NEW = 304;
PHP.Constants.T_CLONE = 305;
PHP.Constants.T_EXIT = 306;
PHP.Constants.T_IF = 307;
PHP.Constants.T_ELSEIF = 308;
PHP.Constants.T_ELSE = 309;
PHP.Constants.T_ENDIF = 310;
PHP.Constants.T_LNUMBER = 311;
PHP.Constants.T_DNUMBER = 312;
PHP.Constants.T_STRING = 313;
PHP.Constants.T_STRING_VARNAME = 314;
PHP.Constants.T_VARIABLE = 315;
PHP.Constants.T_NUM_STRING = 316;
PHP.Constants.T_INLINE_HTML = 317;
PHP.Constants.T_CHARACTER = 318;
PHP.Constants.T_BAD_CHARACTER = 319;
PHP.Constants.T_ENCAPSED_AND_WHITESPACE = 320;
PHP.Constants.T_CONSTANT_ENCAPSED_STRING = 321;
PHP.Constants.T_ECHO = 322;
PHP.Constants.T_DO = 323;
PHP.Constants.T_WHILE = 324;
PHP.Constants.T_ENDWHILE = 325;
PHP.Constants.T_FOR = 326;
PHP.Constants.T_ENDFOR = 327;
PHP.Constants.T_FOREACH = 328;
PHP.Constants.T_ENDFOREACH = 329;
PHP.Constants.T_DECLARE = 330;
PHP.Constants.T_ENDDECLARE = 331;
PHP.Constants.T_AS = 332;
PHP.Constants.T_SWITCH = 333;
PHP.Constants.T_ENDSWITCH = 334;
PHP.Constants.T_CASE = 335;
PHP.Constants.T_DEFAULT = 336;
PHP.Constants.T_BREAK = 337;
PHP.Constants.T_CONTINUE = 338;
PHP.Constants.T_GOTO = 339;
PHP.Constants.T_FUNCTION = 340;
PHP.Constants.T_CONST = 341;
PHP.Constants.T_RETURN = 342;
PHP.Constants.T_TRY = 343;
PHP.Constants.T_CATCH = 344;
PHP.Constants.T_FINALLY = 345;
PHP.Constants.T_THROW = 346;
PHP.Constants.T_USE = 347;
PHP.Constants.T_INSTEADOF = 348;
PHP.Constants.T_GLOBAL = 349;
PHP.Constants.T_STATIC = 350;
PHP.Constants.T_ABSTRACT = 351;
PHP.Constants.T_FINAL = 352;
PHP.Constants.T_PRIVATE = 353;
PHP.Constants.T_PROTECTED = 354;
PHP.Constants.T_PUBLIC = 355;
PHP.Constants.T_VAR = 356;
PHP.Constants.T_UNSET = 357;
PHP.Constants.T_ISSET = 358;
PHP.Constants.T_EMPTY = 359;
PHP.Constants.T_HALT_COMPILER = 360;
PHP.Constants.T_CLASS = 361;
PHP.Constants.T_TRAIT = 362;
PHP.Constants.T_INTERFACE = 363;
PHP.Constants.T_EXTENDS = 364;
PHP.Constants.T_IMPLEMENTS = 365;
PHP.Constants.T_OBJECT_OPERATOR = 366;
PHP.Constants.T_LIST = 367;
PHP.Constants.T_ARRAY = 368;
PHP.Constants.T_CALLABLE = 369;
PHP.Constants.T_CLASS_C = 370;
PHP.Constants.T_TRAIT_C = 371;
PHP.Constants.T_METHOD_C = 372;
PHP.Constants.T_FUNC_C = 373;
PHP.Constants.T_LINE = 374;
PHP.Constants.T_FILE = 375;
PHP.Constants.T_COMMENT = 376;
PHP.Constants.T_DOC_COMMENT = 377;
PHP.Constants.T_OPEN_TAG = 378;
PHP.Constants.T_OPEN_TAG_WITH_ECHO = 379;
PHP.Constants.T_CLOSE_TAG = 380;
PHP.Constants.T_WHITESPACE = 381;
PHP.Constants.T_START_HEREDOC = 382;
PHP.Constants.T_END_HEREDOC = 383;
PHP.Constants.T_DOLLAR_OPEN_CURLY_BRACES = 384;
PHP.Constants.T_CURLY_OPEN = 385;
PHP.Constants.T_PAAMAYIM_NEKUDOTAYIM = 386;
PHP.Constants.T_NAMESPACE = 387;
PHP.Constants.T_NS_C = 388;
PHP.Constants.T_DIR = 389;
PHP.Constants.T_NS_SEPARATOR = 390;
PHP.Constants.T_ELLIPSIS = 391;
PHP.Lexer = function(src, ini) {
var heredoc, heredocEndAllowed,
stateStack = ['INITIAL'], stackPos = 0,
swapState = function(state) {
stateStack[stackPos] = state;
},
pushState = function(state) {
stateStack[++stackPos] = state;
},
popState = function() {
--stackPos;
},
shortOpenTag = ini === undefined || /^(on|true|1)$/i.test(ini.short_open_tag),
openTag = shortOpenTag
? /^(\<\?php(?:\r\n|[ \t\r\n])|<\?|\