forked from glayzzle/php-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp-parser.min.js
More file actions
114 lines (114 loc) · 118 KB
/
php-parser.min.js
File metadata and controls
114 lines (114 loc) · 118 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){
if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,runClearTimeout(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}function noop(){}var cachedSetTimeout,cachedClearTimeout,process=module.exports={};!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout;
}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.binding=function(name){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){throw new Error("process.chdir is not supported")},process.umask=function(){return 0;
}},{}],2:[function(require,module,exports){var Location=require("./ast/location"),Position=require("./ast/position"),AST=function(withPositions,withSource){this.withPositions=withPositions,this.withSource=withSource};AST.prototype.position=function(parser){return new Position(parser.lexer.yylloc.first_line,parser.lexer.yylloc.first_column,parser.lexer.yylloc.first_offset)},AST.precedence={};[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"]].forEach(function(list,index){list.forEach(function(operator){AST.precedence[operator]=index+1})});AST.prototype.resolvePrecedence=function(result){var buffer;if("bin"===result.kind){if(result.right)if("bin"===result.right.kind){var lLevel=AST.precedence[result.type],rLevel=AST.precedence[result.right.type];lLevel&&rLevel&&rLevel<=lLevel&&(buffer=result.right,result.right=result.right.left,buffer.left=this.resolvePrecedence(result),result=buffer);
}else if("retif"===result.right.kind){var lLevel=AST.precedence[result.type],rLevel=AST.precedence["?"];lLevel&&rLevel&&rLevel<=lLevel&&(buffer=result.right,result.right=result.right.test,buffer.test=this.resolvePrecedence(result),result=buffer)}}else if("unary"===result.kind)result.what&&("bin"===result.what.kind?(buffer=result.what,result.what=result.what.left,buffer.left=this.resolvePrecedence(result),result=buffer):"retif"===result.what.kind&&(buffer=result.what,result.what=result.what.test,buffer.test=this.resolvePrecedence(result),result=buffer));else if("retif"===result.kind)result.falseExpr&&"retif"===result.falseExpr.kind&&(buffer=result.falseExpr,result.falseExpr=buffer.test,buffer.test=this.resolvePrecedence(result),result=buffer);else if("assign"===result.kind&&result.right&&"bin"===result.right.kind){var lLevel=AST.precedence["="],rLevel=AST.precedence[result.right.type];lLevel&&rLevel&&rLevel<lLevel&&(buffer=result.right,result.right=result.right.left,buffer.left=result,result=buffer)}return result;
},AST.prototype.prepare=function(kind,parser){var start=null;(this.withPositions||this.withSource)&&(start=this.position(parser));var self=this;return function(){var location=null,args=Array.prototype.slice.call(arguments);if(self.withPositions||self.withSource){var src=null;self.withSource&&(src=parser.lexer._input.substring(start.offset,parser.lexer.yylloc.prev_offset)),location=self.withPositions?new Location(src,start,new Position(parser.lexer.yylloc.prev_line,parser.lexer.yylloc.prev_column,parser.lexer.yylloc.prev_offset)):new Location(src,null,null),args.push(location)}kind||(kind=args.shift());var node=self[kind];if("function"!=typeof node)throw new Error('Undefined node "'+kind+'"');var result=Object.create(node.prototype);return node.apply(result,args),self.resolvePrecedence(result)}},[require("./ast/array"),require("./ast/assign"),require("./ast/bin"),require("./ast/block"),require("./ast/boolean"),require("./ast/break"),require("./ast/call"),require("./ast/case"),require("./ast/cast"),require("./ast/catch"),require("./ast/class"),require("./ast/classconstant"),require("./ast/clone"),require("./ast/closure"),require("./ast/constant"),require("./ast/constref"),require("./ast/continue"),require("./ast/declaration"),require("./ast/declare"),require("./ast/do"),require("./ast/doc"),require("./ast/echo"),require("./ast/empty"),require("./ast/encapsed"),require("./ast/entry"),require("./ast/error"),require("./ast/eval"),require("./ast/exit"),require("./ast/expression"),require("./ast/for"),require("./ast/foreach"),require("./ast/function"),require("./ast/global"),require("./ast/goto"),require("./ast/halt"),require("./ast/identifier"),require("./ast/if"),require("./ast/include"),require("./ast/inline"),require("./ast/interface"),require("./ast/isset"),require("./ast/label"),require("./ast/list"),require("./ast/literal"),require("./ast/lookup"),require("./ast/magic"),require("./ast/method"),require("./ast/namespace"),require("./ast/new"),require("./ast/node"),require("./ast/nowdoc"),require("./ast/number"),require("./ast/offsetlookup"),require("./ast/operation"),require("./ast/parameter"),require("./ast/parenthesis"),require("./ast/post"),require("./ast/pre"),require("./ast/print"),require("./ast/program"),require("./ast/property"),require("./ast/propertylookup"),require("./ast/retif"),require("./ast/return"),require("./ast/silent"),require("./ast/statement"),require("./ast/static"),require("./ast/staticlookup"),require("./ast/string"),require("./ast/switch"),require("./ast/sys"),require("./ast/throw"),require("./ast/trait"),require("./ast/traitalias"),require("./ast/traitprecedence"),require("./ast/traituse"),require("./ast/try"),require("./ast/unary"),require("./ast/unset"),require("./ast/usegroup"),require("./ast/useitem"),require("./ast/variable"),require("./ast/variadic"),require("./ast/while"),require("./ast/yield"),require("./ast/yieldfrom")].forEach(function(ctor){
var kind=ctor.prototype.constructor.name.toLowerCase();"_"===kind[0]&&(kind=kind.substring(1)),AST.prototype[kind]=ctor}),module.exports=AST},{"./ast/array":3,"./ast/assign":4,"./ast/bin":5,"./ast/block":6,"./ast/boolean":7,"./ast/break":8,"./ast/call":9,"./ast/case":10,"./ast/cast":11,"./ast/catch":12,"./ast/class":13,"./ast/classconstant":14,"./ast/clone":15,"./ast/closure":16,"./ast/constant":17,"./ast/constref":18,"./ast/continue":19,"./ast/declaration":20,"./ast/declare":21,"./ast/do":22,"./ast/doc":23,"./ast/echo":24,"./ast/empty":25,"./ast/encapsed":26,"./ast/entry":27,"./ast/error":28,"./ast/eval":29,"./ast/exit":30,"./ast/expression":31,"./ast/for":32,"./ast/foreach":33,"./ast/function":34,"./ast/global":35,"./ast/goto":36,"./ast/halt":37,"./ast/identifier":38,"./ast/if":39,"./ast/include":40,"./ast/inline":41,"./ast/interface":42,"./ast/isset":43,"./ast/label":44,"./ast/list":45,"./ast/literal":46,"./ast/location":47,"./ast/lookup":48,"./ast/magic":49,"./ast/method":50,"./ast/namespace":51,"./ast/new":52,
"./ast/node":53,"./ast/nowdoc":54,"./ast/number":55,"./ast/offsetlookup":56,"./ast/operation":57,"./ast/parameter":58,"./ast/parenthesis":59,"./ast/position":60,"./ast/post":61,"./ast/pre":62,"./ast/print":63,"./ast/program":64,"./ast/property":65,"./ast/propertylookup":66,"./ast/retif":67,"./ast/return":68,"./ast/silent":69,"./ast/statement":70,"./ast/static":71,"./ast/staticlookup":72,"./ast/string":73,"./ast/switch":74,"./ast/sys":75,"./ast/throw":76,"./ast/trait":77,"./ast/traitalias":78,"./ast/traitprecedence":79,"./ast/traituse":80,"./ast/try":81,"./ast/unary":82,"./ast/unset":83,"./ast/usegroup":84,"./ast/useitem":85,"./ast/variable":86,"./ast/variadic":87,"./ast/while":88,"./ast/yield":89,"./ast/yieldfrom":90}],3:[function(require,module,exports){var Expr=require("./expression"),KIND="array",Array=Expr.extends(function Array(shortForm,items,location){Expr.apply(this,[KIND,location]),this.items=items,this.shortForm=shortForm});module.exports=Array},{"./expression":31}],4:[function(require,module,exports){
var Statement=require("./statement"),KIND="assign",Assign=Statement.extends(function Assign(left,right,operator,location){Statement.apply(this,[KIND,location]),this.operator=operator,this.left=left,this.right=right});module.exports=Assign},{"./statement":70}],5:[function(require,module,exports){"use strict";var Operation=require("./operation"),KIND="bin",Bin=Operation.extends(function Bin(type,left,right,location){Operation.apply(this,[KIND,location]),this.type=type,this.left=left,this.right=right});module.exports=Bin},{"./operation":57}],6:[function(require,module,exports){var Statement=require("./statement"),KIND="block",Block=Statement.extends(function Block(kind,children,location){Statement.apply(this,[kind||KIND,location]),this.children=children});module.exports=Block},{"./statement":70}],7:[function(require,module,exports){var Literal=require("./literal"),KIND="boolean",Boolean=Literal.extends(function Boolean(value,location){Literal.apply(this,[KIND,value,location])});module.exports=Boolean},{"./literal":46
}],8:[function(require,module,exports){"use strict";var Node=require("./node"),KIND="break",Break=Node.extends(function Break(level,location){Node.apply(this,[KIND,location]),this.level=level});module.exports=Break},{"./node":53}],9:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="call",Call=Statement.extends(function Call(what,args,location){Statement.apply(this,[KIND,location]),this.what=what,this.arguments=args});module.exports=Call},{"./statement":70}],10:[function(require,module,exports){"use strict";var Node=require("./node"),KIND="case",Case=Node.extends(function Case(test,body,location){Node.apply(this,[KIND,location]),this.test=test,this.body=body});module.exports=Case},{"./node":53}],11:[function(require,module,exports){"use strict";var Operation=require("./operation"),KIND="cast",Cast=Operation.extends(function Cast(type,what,location){Operation.apply(this,[KIND,location]),this.type=type,this.what=what});module.exports=Cast},{"./operation":57}],12:[function(require,module,exports){
"use strict";var Statement=require("./statement"),KIND="catch",Catch=Statement.extends(function Catch(body,what,variable,location){Statement.apply(this,[KIND,location]),this.body=body,this.what=what,this.variable=variable});module.exports=Catch},{"./statement":70}],13:[function(require,module,exports){var Declaration=require("./declaration"),KIND="class",Class=Declaration.extends(function Class(name,ext,impl,body,flags,location){Declaration.apply(this,[KIND,name,location]),this.isAnonymous=!name,this.extends=ext,this.implements=impl,this.body=body,this.parseFlags(flags)});module.exports=Class},{"./declaration":20}],14:[function(require,module,exports){var Constant=require("./constant"),KIND="classconstant",ClassConstant=Constant.extends(function ClassConstant(name,value,flags,location){Constant.apply(this,[name,value,location]),this.kind=KIND,this.parseFlags(flags)});module.exports=ClassConstant},{"./constant":17}],15:[function(require,module,exports){var Statement=require("./statement"),KIND="clone",Clone=Statement.extends(function Clone(what,location){
Statement.apply(this,[KIND,location]),this.what=what});module.exports=Clone},{"./statement":70}],16:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="closure",Closure=Statement.extends(function Closure(args,byref,uses,type,nullable,isStatic,location){Statement.apply(this,[KIND,location]),this.uses=uses,this.arguments=args,this.byref=byref,this.type=type,this.nullable=nullable,this.isStatic=isStatic||!1,this.body=null});module.exports=Closure},{"./statement":70}],17:[function(require,module,exports){var Declaration=require("./declaration"),KIND="constant",Constant=Declaration.extends(function Constant(name,value,location){Declaration.apply(this,[KIND,name,location]),this.value=value});module.exports=Constant},{"./declaration":20}],18:[function(require,module,exports){var Expr=require("./expression"),KIND="constref",ConstRef=Expr.extends(function ConstRef(identifier,location){Expr.apply(this,[KIND,location]),this.name=identifier});module.exports=ConstRef},{"./expression":31
}],19:[function(require,module,exports){"use strict";var Node=require("./node"),KIND="continue",Continue=Node.extends(function Continue(level,location){Node.apply(this,[KIND,location]),this.level=level});module.exports=Continue},{"./node":53}],20:[function(require,module,exports){var Statement=require("./statement"),KIND="declaration",IS_PUBLIC="public",IS_PROTECTED="protected",IS_PRIVATE="private",Declaration=Statement.extends(function Declaration(kind,name,location){Statement.apply(this,[kind||KIND,location]),this.name=name});Declaration.prototype.parseFlags=function(flags){this.isAbstract=1===flags[2],this.isFinal=2===flags[2],"class"!==this.kind&&(0===flags[0]?this.visibility=IS_PUBLIC:1===flags[0]?this.visibility=IS_PROTECTED:2===flags[0]&&(this.visibility=IS_PRIVATE),this.isStatic=1===flags[1])},module.exports=Declaration},{"./statement":70}],21:[function(require,module,exports){var Block=require("./block"),KIND="declare",Declare=Block.extends(function Declare(what,body,mode,location){Block.apply(this,[KIND,body,location]),
this.what=what,this.mode=mode});Declare.MODE_SHORT="short",Declare.MODE_BLOCK="block",Declare.MODE_NONE="none",module.exports=Declare},{"./block":6}],22:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="do",Do=Statement.extends(function Do(test,body,location){Statement.apply(this,[KIND,location]),this.test=test,this.body=body});module.exports=Do},{"./statement":70}],23:[function(require,module,exports){var Node=require("./node"),KIND="doc",Doc=Node.extends(function Doc(isDoc,lines,location){Node.apply(this,[KIND,location]),this.isDoc=isDoc,this.lines=lines});module.exports=Doc},{"./node":53}],24:[function(require,module,exports){var Sys=require("./sys"),KIND="echo",Echo=Sys.extends(function Echo(args,location){Sys.apply(this,[KIND,args,location])});module.exports=Echo},{"./sys":75}],25:[function(require,module,exports){var Sys=require("./sys"),KIND="empty",Empty=Sys.extends(function Empty(args,location){Sys.apply(this,[KIND,args,location])});module.exports=Empty},{"./sys":75
}],26:[function(require,module,exports){var Literal=require("./literal"),KIND="encapsed",Encapsed=Literal.extends(function Encapsed(value,type,location){Literal.apply(this,[KIND,value,location]),this.type=type});Encapsed.TYPE_STRING="string",Encapsed.TYPE_SHELL="shell",Encapsed.TYPE_HEREDOC="heredoc",Encapsed.TYPE_OFFSET="offset",module.exports=Encapsed},{"./literal":46}],27:[function(require,module,exports){var Node=require("./node"),KIND="entry",Entry=Node.extends(function Entry(key,value,location){Node.apply(this,[KIND,location]),this.key=key,this.value=value});module.exports=Entry},{"./node":53}],28:[function(require,module,exports){var Node=require("./node"),KIND="error",Error=Node.extends(function Error(message,token,line,expected,location){Node.apply(this,[KIND,location]),this.message=message,this.token=token,this.line=line,this.expected=expected});module.exports=Error},{"./node":53}],29:[function(require,module,exports){var Statement=require("./statement"),KIND="eval",Eval=Statement.extends(function Eval(source,location){
Statement.apply(this,[KIND,location]),this.source=source});module.exports=Eval},{"./statement":70}],30:[function(require,module,exports){var Statement=require("./statement"),KIND="exit",Exit=Statement.extends(function Exit(status,location){Statement.apply(this,[KIND,location]),this.status=status});module.exports=Exit},{"./statement":70}],31:[function(require,module,exports){var Node=require("./node"),KIND="expression",Expression=Node.extends(function Expression(kind,location){Node.apply(this,[kind||KIND,location])});module.exports=Expression},{"./node":53}],32:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="for",For=Statement.extends(function For(init,test,increment,body,shortForm,location){Statement.apply(this,[KIND,location]),this.init=init,this.test=test,this.increment=increment,this.shortForm=shortForm,this.body=body});module.exports=For},{"./statement":70}],33:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="foreach",Foreach=Statement.extends(function Foreach(source,key,value,body,shortForm,location){
Statement.apply(this,[KIND,location]),this.source=source,this.key=key,this.value=value,this.shortForm=shortForm,this.body=body});module.exports=Foreach},{"./statement":70}],34:[function(require,module,exports){var Declaration=require("./declaration"),KIND="function",fn=Declaration.extends(function _Function(name,args,byref,type,nullable,location){Declaration.apply(this,[KIND,name,location]),this.arguments=args,this.byref=byref,this.type=type,this.nullable=nullable,this.body=null});module.exports=fn},{"./declaration":20}],35:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="global",Global=Statement.extends(function Global(items,location){Statement.apply(this,[KIND,location]),this.items=items});module.exports=Global},{"./statement":70}],36:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="goto",Goto=Statement.extends(function Goto(label,location){Statement.apply(this,[KIND,location]),this.label=label});module.exports=Goto},{"./statement":70
}],37:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="halt",Halt=Statement.extends(function Halt(after,location){Statement.apply(this,[KIND,location]),this.after=after});module.exports=Halt},{"./statement":70}],38:[function(require,module,exports){var Node=require("./node"),KIND="identifier",Identifier=Node.extends(function Identifier(name,isRelative,location){Node.apply(this,[KIND,location]),isRelative?this.resolution=Identifier.RELATIVE_NAME:1===name.length?this.resolution=Identifier.UNQUALIFIED_NAME:""===name[0]?this.resolution=Identifier.FULL_QUALIFIED_NAME:this.resolution=Identifier.QUALIFIED_NAME,this.name=name.join("\\")});Identifier.UNQUALIFIED_NAME="uqn",Identifier.QUALIFIED_NAME="qn",Identifier.FULL_QUALIFIED_NAME="fqn",Identifier.RELATIVE_NAME="rn",module.exports=Identifier},{"./node":53}],39:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="if",If=Statement.extends(function If(test,body,alternate,shortForm,location){Statement.apply(this,[KIND,location]),
this.test=test,this.body=body,this.alternate=alternate,this.shortForm=shortForm});module.exports=If},{"./statement":70}],40:[function(require,module,exports){var Statement=require("./statement"),KIND="include",Include=Statement.extends(function Include(once,require,target,location){Statement.apply(this,[KIND,location]),this.once=once,this.require=require,this.target=target});module.exports=Include},{"./statement":70}],41:[function(require,module,exports){var Literal=require("./literal"),KIND="inline",Inline=Literal.extends(function Inline(value,location){Literal.apply(this,[KIND,value,location])});module.exports=Inline},{"./literal":46}],42:[function(require,module,exports){var Declaration=require("./declaration"),KIND="interface",Interface=Declaration.extends(function Interface(name,ext,body,location){Declaration.apply(this,[KIND,name,location]),this.extends=ext,this.body=body});module.exports=Interface},{"./declaration":20}],43:[function(require,module,exports){var Sys=require("./sys"),KIND="isset",Isset=Sys.extends(function Isset(args,location){
Sys.apply(this,[KIND,args,location])});module.exports=Isset},{"./sys":75}],44:[function(require,module,exports){"use strict";var Node=require("./node"),KIND="label",Label=Node.extends(function Label(name,location){Node.apply(this,[KIND,location]),this.name=name});module.exports=Label},{"./node":53}],45:[function(require,module,exports){var Sys=require("./sys"),KIND="list",List=Sys.extends(function List(args,location){Sys.apply(this,[KIND,args,location])});module.exports=List},{"./sys":75}],46:[function(require,module,exports){var Expr=require("./expression"),KIND="literal",Literal=Expr.extends(function Literal(kind,value,location){Expr.apply(this,[kind||KIND,location]),this.value=value});module.exports=Literal},{"./expression":31}],47:[function(require,module,exports){var Location=function(source,start,end){this.source=source,this.start=start,this.end=end};module.exports=Location},{}],48:[function(require,module,exports){var Expr=require("./expression"),KIND="lookup",Lookup=Expr.extends(function Lookup(kind,what,offset,location){
Expr.apply(this,[kind||KIND,location]),this.what=what,this.offset=offset});module.exports=Lookup},{"./expression":31}],49:[function(require,module,exports){var Literal=require("./literal"),KIND="magic",Magic=Literal.extends(function Magic(value,location){Literal.apply(this,[KIND,value,location])});module.exports=Magic},{"./literal":46}],50:[function(require,module,exports){var fn=require("./function"),KIND="method",Method=fn.extends(function Method(){fn.apply(this,arguments),this.kind=KIND});module.exports=Method},{"./function":34}],51:[function(require,module,exports){var Block=require("./block"),KIND=(require("./identifier"),"namespace"),Namespace=Block.extends(function Namespace(name,children,withBrackets,location){Block.apply(this,[KIND,children,location]),this.name=name,this.withBrackets=withBrackets||!1});module.exports=Namespace},{"./block":6,"./identifier":38}],52:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="new",New=Statement.extends(function New(what,args,location){
Statement.apply(this,[KIND,location]),this.what=what,this.arguments=args});module.exports=New},{"./statement":70}],53:[function(require,module,exports){var Node=function Node(kind,location){this.kind=kind,location&&(this.loc=location)};Node.extends=function(constructor){return constructor.prototype=Object.create(this.prototype),constructor.extends=this.extends,constructor.prototype.constructor=constructor,constructor},module.exports=Node},{}],54:[function(require,module,exports){var Literal=require("./literal"),KIND="nowdoc",Nowdoc=Literal.extends(function Nowdoc(value,label,location){Literal.apply(this,[KIND,value,location]),this.label=label});module.exports=Nowdoc},{"./literal":46}],55:[function(require,module,exports){var Literal=require("./literal"),KIND="number",_Number=Literal.extends(function Number(value,location){Literal.apply(this,[KIND,value,location])});module.exports=_Number},{"./literal":46}],56:[function(require,module,exports){"use strict";var Lookup=require("./lookup"),KIND="offsetlookup",OffsetLookup=Lookup.extends(function OffsetLookup(what,offset,location){
Lookup.apply(this,[KIND,what,offset,location])});module.exports=OffsetLookup},{"./lookup":48}],57:[function(require,module,exports){"use strict";var Expr=require("./expression"),KIND="operation",Operation=Expr.extends(function Operation(kind,location){Expr.apply(this,[kind||KIND,location])});module.exports=Operation},{"./expression":31}],58:[function(require,module,exports){var Declaration=require("./declaration"),KIND="parameter",Parameter=Declaration.extends(function Parameter(name,type,value,isRef,isVariadic,nullable,location){Declaration.apply(this,[KIND,name,location]),this.value=value,this.type=type,this.byref=isRef,this.variadic=isVariadic,this.nullable=nullable});module.exports=Parameter},{"./declaration":20}],59:[function(require,module,exports){"use strict";var Operation=require("./operation"),KIND="parenthesis",Parenthesis=Operation.extends(function Parenthesis(inner,location){Operation.apply(this,[KIND,location]),this.inner=inner});module.exports=Parenthesis},{"./operation":57}],60:[function(require,module,exports){
var Position=function(line,column,offset){this.line=line,this.column=column,this.offset=offset};module.exports=Position},{}],61:[function(require,module,exports){"use strict";var Operation=require("./operation"),KIND="post",Post=Operation.extends(function Post(type,what,location){Operation.apply(this,[KIND,location]),this.type=type,this.what=what});module.exports=Post},{"./operation":57}],62:[function(require,module,exports){"use strict";var Operation=require("./operation"),KIND="pre",Pre=Operation.extends(function Pre(type,what,location){Operation.apply(this,[KIND,location]),this.type=type,this.what=what});module.exports=Pre},{"./operation":57}],63:[function(require,module,exports){var Sys=require("./sys"),KIND="print",Print=Sys.extends(function Print(args,location){Sys.apply(this,[KIND,args,location])});module.exports=Print},{"./sys":75}],64:[function(require,module,exports){var Block=require("./block"),KIND="program",Program=Block.extends(function Program(children,errors,location){Block.apply(this,[KIND,children,location]),
this.errors=errors});module.exports=Program},{"./block":6}],65:[function(require,module,exports){var Declaration=require("./declaration"),KIND="property",Property=Declaration.extends(function Property(name,value,flags,location){Declaration.apply(this,[KIND,name,location]),this.value=value,this.parseFlags(flags)});module.exports=Property},{"./declaration":20}],66:[function(require,module,exports){"use strict";var Lookup=require("./lookup"),KIND="propertylookup",PropertyLookup=Lookup.extends(function PropertyLookup(what,offset,location){Lookup.apply(this,[KIND,what,offset,location])});module.exports=PropertyLookup},{"./lookup":48}],67:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="retif",RetIf=Statement.extends(function RetIf(test,trueExpr,falseExpr,location){Statement.apply(this,[KIND,location]),this.test=test,this.trueExpr=trueExpr,this.falseExpr=falseExpr});module.exports=RetIf},{"./statement":70}],68:[function(require,module,exports){"use strict";var Node=require("./node"),KIND="return",Return=Node.extends(function Return(expr,location){
Node.apply(this,[KIND,location]),this.expr=expr});module.exports=Return},{"./node":53}],69:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="silent",Silent=Statement.extends(function Silent(expr,location){Statement.apply(this,[KIND,location]),this.expr=expr});module.exports=Silent},{"./statement":70}],70:[function(require,module,exports){var Node=require("./node"),KIND="statement",Statement=Node.extends(function Statement(kind,location){Node.apply(this,[kind||KIND,location])});module.exports=Statement},{"./node":53}],71:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="static",Static=Statement.extends(function Static(items,location){Statement.apply(this,[KIND,location]),this.items=items});module.exports=Static},{"./statement":70}],72:[function(require,module,exports){"use strict";var Lookup=require("./lookup"),KIND="staticlookup",StaticLookup=Lookup.extends(function StaticLookup(what,offset,location){Lookup.apply(this,[KIND,what,offset,location]);
});module.exports=StaticLookup},{"./lookup":48}],73:[function(require,module,exports){var Literal=require("./literal"),KIND="string",String=Literal.extends(function String(isDoubleQuote,value,location){Literal.apply(this,[KIND,value,location]),this.isDoubleQuote=isDoubleQuote});module.exports=String},{"./literal":46}],74:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="switch",Switch=Statement.extends(function Switch(test,body,shortForm,location){Statement.apply(this,[KIND,location]),this.test=test,this.body=body,this.shortForm=shortForm});module.exports=Switch},{"./statement":70}],75:[function(require,module,exports){var Statement=require("./statement"),KIND="sys",Sys=Statement.extends(function Sys(kind,args,location){Statement.apply(this,[kind||KIND,location]),this.arguments=args});module.exports=Sys},{"./statement":70}],76:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="throw",Throw=Statement.extends(function Throw(what,location){
Statement.apply(this,[KIND,location]),this.what=what});module.exports=Throw},{"./statement":70}],77:[function(require,module,exports){var Declaration=require("./declaration"),KIND="trait",Trait=Declaration.extends(function Trait(name,ext,impl,body,location){Declaration.apply(this,[KIND,name,location]),this.extends=ext,this.implements=impl,this.body=body});module.exports=Trait},{"./declaration":20}],78:[function(require,module,exports){var Node=require("./node"),KIND="traitalias",IS_PUBLIC="public",IS_PROTECTED="protected",IS_PRIVATE="private",TraitAlias=Node.extends(function TraitAlias(trait,method,as,flags,location){Node.apply(this,[KIND,location]),this.trait=trait,this.method=method,this.as=as,flags?0===flags[0]?this.visibility=IS_PUBLIC:1===flags[0]?this.visibility=IS_PROTECTED:this.visibility=IS_PRIVATE:this.visibility=null});module.exports=TraitAlias},{"./node":53}],79:[function(require,module,exports){var Node=require("./node"),KIND="traitprecedence",TraitPrecedence=Node.extends(function TraitPrecedence(trait,method,instead,location){
Node.apply(this,[KIND,location]),this.trait=trait,this.method=method,this.instead=instead});module.exports=TraitPrecedence},{"./node":53}],80:[function(require,module,exports){var Node=require("./node"),KIND="traituse",TraitUse=Node.extends(function TraitUse(traits,adaptations,location){Node.apply(this,[KIND,location]),this.traits=traits,this.adaptations=adaptations});module.exports=TraitUse},{"./node":53}],81:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="try",Try=Statement.extends(function Try(body,catches,always,location){Statement.apply(this,[KIND,location]),this.body=body,this.catches=catches,this.always=always});module.exports=Try},{"./statement":70}],82:[function(require,module,exports){"use strict";var Operation=require("./operation"),KIND="unary",Unary=Operation.extends(function Unary(type,what,location){Operation.apply(this,[KIND,location]),this.type=type,this.what=what});module.exports=Unary},{"./operation":57}],83:[function(require,module,exports){var Sys=require("./sys"),KIND="unset",Unset=Sys.extends(function Unset(args,location){
Sys.apply(this,[KIND,args,location])});module.exports=Unset},{"./sys":75}],84:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="usegroup",UseGroup=Statement.extends(function UseGroup(name,type,items,location){Statement.apply(this,[KIND,location]),this.name=name,this.type=type,this.items=items});module.exports=UseGroup},{"./statement":70}],85:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="useitem",UseItem=Statement.extends(function UseItem(name,alias,type,location){Statement.apply(this,[KIND,location]),this.name=name,this.alias=alias,this.type=type});UseItem.TYPE_CONST="const",UseItem.TYPE_FUNCTION="function",module.exports=UseItem},{"./statement":70}],86:[function(require,module,exports){"use strict";var Expr=require("./expression"),KIND="variable",Variable=Expr.extends(function Variable(name,byref,curly,location){Expr.apply(this,[KIND,location]),this.name=name,this.byref=byref||!1,this.curly=curly||!1});module.exports=Variable},{
"./expression":31}],87:[function(require,module,exports){"use strict";var Expr=require("./expression"),KIND="variadic",Variadic=Expr.extends(function Variadic(what,location){Expr.apply(this,[KIND,location]),this.what=what});module.exports=Variadic},{"./expression":31}],88:[function(require,module,exports){"use strict";var Statement=require("./statement"),KIND="while",While=Statement.extends(function While(test,body,shortForm,location){Statement.apply(this,[KIND,location]),this.test=test,this.body=body,this.shortForm=shortForm});module.exports=While},{"./statement":70}],89:[function(require,module,exports){"use strict";var Expression=require("./expression"),KIND="yield",Yield=Expression.extends(function Yield(value,key,location){Expression.apply(this,[KIND,location]),this.value=value,this.key=key});module.exports=Yield},{"./expression":31}],90:[function(require,module,exports){"use strict";var Expression=require("./expression"),KIND="yieldfrom",YieldFrom=Expression.extends(function YieldFrom(value,location){Expression.apply(this,[KIND,location]),
this.value=value});module.exports=YieldFrom},{"./expression":31}],91:[function(require,module,exports){"use strict";var lexer=function(engine){this.engine=engine,this.tok=this.engine.tokens.names,this.EOF=1,this.debug=!1,this.all_tokens=!0,this.comment_tokens=!1,this.mode_eval=!1,this.asp_tags=!1,this.short_tags=!0,this.yyprevcol=0,this.keywords={__class__:this.tok.T_CLASS_C,__trait__:this.tok.T_TRAIT_C,__function__:this.tok.T_FUNC_C,__method__:this.tok.T_METHOD_C,__line__:this.tok.T_LINE,__file__:this.tok.T_FILE,__dir__:this.tok.T_DIR,__namespace__:this.tok.T_NS_C,exit:this.tok.T_EXIT,die:this.tok.T_EXIT,function:this.tok.T_FUNCTION,const:this.tok.T_CONST,return:this.tok.T_RETURN,try:this.tok.T_TRY,catch:this.tok.T_CATCH,finally:this.tok.T_FINALLY,throw:this.tok.T_THROW,if:this.tok.T_IF,elseif:this.tok.T_ELSEIF,endif:this.tok.T_ENDIF,else:this.tok.T_ELSE,while:this.tok.T_WHILE,endwhile:this.tok.T_ENDWHILE,do:this.tok.T_DO,for:this.tok.T_FOR,endfor:this.tok.T_ENDFOR,foreach:this.tok.T_FOREACH,endforeach:this.tok.T_ENDFOREACH,
declare:this.tok.T_DECLARE,enddeclare:this.tok.T_ENDDECLARE,instanceof:this.tok.T_INSTANCEOF,as:this.tok.T_AS,switch:this.tok.T_SWITCH,endswitch:this.tok.T_ENDSWITCH,case:this.tok.T_CASE,default:this.tok.T_DEFAULT,break:this.tok.T_BREAK,continue:this.tok.T_CONTINUE,goto:this.tok.T_GOTO,echo:this.tok.T_ECHO,print:this.tok.T_PRINT,class:this.tok.T_CLASS,interface:this.tok.T_INTERFACE,trait:this.tok.T_TRAIT,extends:this.tok.T_EXTENDS,implements:this.tok.T_IMPLEMENTS,new:this.tok.T_NEW,clone:this.tok.T_CLONE,var:this.tok.T_VAR,eval:this.tok.T_EVAL,include:this.tok.T_INCLUDE,include_once:this.tok.T_INCLUDE_ONCE,require:this.tok.T_REQUIRE,require_once:this.tok.T_REQUIRE_ONCE,namespace:this.tok.T_NAMESPACE,use:this.tok.T_USE,insteadof:this.tok.T_INSTEADOF,global:this.tok.T_GLOBAL,isset:this.tok.T_ISSET,empty:this.tok.T_EMPTY,__halt_compiler:this.tok.T_HALT_COMPILER,static:this.tok.T_STATIC,abstract:this.tok.T_ABSTRACT,final:this.tok.T_FINAL,private:this.tok.T_PRIVATE,protected:this.tok.T_PROTECTED,public:this.tok.T_PUBLIC,
unset:this.tok.T_UNSET,list:this.tok.T_LIST,array:this.tok.T_ARRAY,callable:this.tok.T_CALLABLE,or:this.tok.T_LOGICAL_OR,and:this.tok.T_LOGICAL_AND,xor:this.tok.T_LOGICAL_XOR},this.castKeywords={int:this.tok.T_INT_CAST,integer:this.tok.T_INT_CAST,real:this.tok.T_DOUBLE_CAST,double:this.tok.T_DOUBLE_CAST,float:this.tok.T_DOUBLE_CAST,string:this.tok.T_STRING_CAST,binary:this.tok.T_STRING_CAST,array:this.tok.T_ARRAY_CAST,object:this.tok.T_OBJECT_CAST,bool:this.tok.T_BOOL_CAST,boolean:this.tok.T_BOOL_CAST,unset:this.tok.T_UNSET_CAST}};lexer.prototype.setInput=function(input){return this._input=input,this.size=input.length,this.yylineno=1,this.offset=0,this.yyprevcol=0,this.yytext="",this.yylloc={first_offset:0,first_line:1,first_column:0,prev_offset:0,prev_line:1,prev_column:0,last_line:1,last_column:0},this.tokens=[],this.conditionStack=[],this.done=this.offset>=this.size,!this.all_tokens&&this.mode_eval?this.begin("ST_IN_SCRIPTING"):this.begin("INITIAL"),this},lexer.prototype.input=function(size){var ch=this._input[this.offset];
return ch?(this.yytext+=ch,this.offset++,"\r"===ch&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++),"\n"===ch||"\r"===ch?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++,ch):""},lexer.prototype.unput=function(size){if(1===size)this.offset--,"\n"===this._input[this.offset]&&"\r"===this._input[this.offset-1]&&(this.offset--,size++),"\r"===this._input[this.offset]||"\n"===this._input[this.offset]?(this.yylloc.last_line--,this.yylineno--,this.yylloc.last_column=this.yyprevcol):this.yylloc.last_column--,this.yytext=this.yytext.substring(0,this.yytext.length-size);else if(size>0)if(this.offset-=size,size<this.yytext.length){this.yytext=this.yytext.substring(0,this.yytext.length-size),this.yylloc.last_line=this.yylloc.first_line,this.yylloc.last_column=this.yyprevcol=this.yylloc.first_column;for(var i=0;i<this.yytext.length;i++){var c=this.yytext[i];"\r"===c?(c=this.yytext[++i],this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,
this.yylloc.last_column=0,"\n"!==c&&("\r"===c?this.yylloc.last_line++:this.yylloc.last_column++)):"\n"===c?(this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++}this.yylineno=this.yylloc.last_line}else this.yytext="",this.yylloc.last_line=this.yylineno=this.yylloc.first_line,this.yylloc.last_column=this.yylloc.first_column;return this},lexer.prototype.tryMatch=function(text){return text===this.ahead(text.length)},lexer.prototype.tryMatchCaseless=function(text){return text===this.ahead(text.length).toLowerCase()},lexer.prototype.ahead=function(size){var text=this._input.substring(this.offset,this.offset+size);return"\r"===text[text.length-1]&&"\n"===this._input[this.offset+size+1]&&(text+="\n"),text},lexer.prototype.consume=function(size){for(var i=0;i<size;i++){var ch=this._input[this.offset];if(!ch)break;this.yytext+=ch,this.offset++,"\r"===ch&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++,i++),"\n"===ch||"\r"===ch?(this.yylloc.last_line=++this.yylineno,
this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++}return this},lexer.prototype.getState=function(){return{yytext:this.yytext,offset:this.offset,yylineno:this.yylineno,yyprevcol:this.yyprevcol,yylloc:{first_offset:this.yylloc.first_offset,first_line:this.yylloc.first_line,first_column:this.yylloc.first_column,last_line:this.yylloc.last_line,last_column:this.yylloc.last_column}}},lexer.prototype.setState=function(state){return this.yytext=state.yytext,this.offset=state.offset,this.yylineno=state.yylineno,this.yyprevcol=state.yyprevcol,this.yylloc=state.yylloc,this},lexer.prototype.appendToken=function(value,ahead){return this.tokens.push([value,ahead]),this},lexer.prototype.lex=function(){this.yylloc.prev_offset=this.offset,this.yylloc.prev_line=this.yylloc.last_line,this.yylloc.prev_column=this.yylloc.last_column;var token=this.next()||this.lex();if(!this.all_tokens){for(;token===this.tok.T_WHITESPACE||!this.comment_tokens&&(token===this.tok.T_COMMENT||token===this.tok.T_DOC_COMMENT)||token===this.tok.T_OPEN_TAG;)token=this.next()||this.lex();
if(!this.mode_eval&&token==this.tok.T_OPEN_TAG_WITH_ECHO)return this.tok.T_ECHO}return this.yylloc.prev_offset||(this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column),token},lexer.prototype.begin=function(condition){if(this.conditionStack.push(condition),this.curCondition=condition,this.stateCb=this["match"+condition],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+condition+'"');return this},lexer.prototype.popState=function(){var n=this.conditionStack.length-1,condition=n>0?this.conditionStack.pop():this.conditionStack[0];if(this.curCondition=this.conditionStack[this.conditionStack.length-1],this.stateCb=this["match"+this.curCondition],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+this.curCondition+'"');return condition},lexer.prototype.next=function(){var token;if(this._input||(this.done=!0),this.yylloc.first_offset=this.offset,this.yylloc.first_line=this.yylloc.last_line,
this.yylloc.first_column=this.yylloc.last_column,this.yytext="",this.done)return this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column,this.EOF;if(this.tokens.length>0?(token=this.tokens.shift(),"object"==typeof token[1]?this.setState(token[1]):this.consume(token[1]),token=token[0]):token=this.stateCb.apply(this,[]),this.offset>=this.size&&0===this.tokens.length&&(this.done=!0),this.debug){var tName=token;tName="number"==typeof tName?this.engine.tokens.values[tName]:'"'+tName+'"';var e=new Error(tName+"\tfrom "+this.yylloc.first_line+","+this.yylloc.first_column+"\t - to "+this.yylloc.last_line+","+this.yylloc.last_column+'\t"'+this.yytext+'"');console.log(e.stack)}return token},[require("./lexer/comments.js"),require("./lexer/initial.js"),require("./lexer/numbers.js"),require("./lexer/property.js"),require("./lexer/scripting.js"),require("./lexer/strings.js"),require("./lexer/tokens.js"),require("./lexer/utils.js")].forEach(function(ext){
for(var k in ext)lexer.prototype[k]=ext[k]}),module.exports=lexer},{"./lexer/comments.js":92,"./lexer/initial.js":93,"./lexer/numbers.js":94,"./lexer/property.js":95,"./lexer/scripting.js":96,"./lexer/strings.js":97,"./lexer/tokens.js":98,"./lexer/utils.js":99}],92:[function(require,module,exports){"use strict";module.exports={T_COMMENT:function(){for(;this.offset<this.size;){var ch=this.input();if("\n"===ch||"\r"===ch)return this.tok.T_COMMENT;if("?"===ch&&!this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT;if("%"===ch&&this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT}return this.tok.T_COMMENT},T_DOC_COMMENT:function(){var ch=this.input(),token=this.tok.T_COMMENT;if("*"===ch){if(ch=this.input(),this.is_WHITESPACE()&&(token=this.tok.T_DOC_COMMENT),"/"===ch)return token;this.unput(1)}for(;this.offset<this.size;)if(ch=this.input(),"*"===ch&&"/"===this._input[this.offset]){this.input();break}return token}}},{}],93:[function(require,module,exports){
module.exports={nextINITIAL:function(){return this.conditionStack.length>1&&"INITIAL"===this.conditionStack[this.conditionStack.length-1]?this.popState():this.begin("ST_IN_SCRIPTING"),this},matchINITIAL:function(){for(;this.offset<this.size;){var ch=this.input();if("<"==ch)if(ch=this.ahead(1),"?"==ch){if(this.tryMatch("?=")){this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}if(this.tryMatchCaseless("?php")&&(ch=this._input[this.offset+4]," "===ch||"\t"===ch||"\n"===ch||"\r"===ch)){this.unput(1).appendToken(this.tok.T_OPEN_TAG,6).nextINITIAL();break}if(this.short_tags){this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}else if(this.asp_tags&&"%"==ch){if(this.tryMatch("%=")){this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}return this.yytext.length>0&&this.tok.T_INLINE_HTML}}},{}],94:[function(require,module,exports){(function(process){
"use strict";if("x64"==process.arch)var MAX_LENGTH_OF_LONG=19,long_min_digits="9223372036854775808";else var MAX_LENGTH_OF_LONG=10,long_min_digits="2147483648";module.exports={consume_NUM:function(){var ch=this.yytext[0],hasPoint="."===this.yytext[0];if("0"===ch)if(ch=this.input(),"x"===ch||"X"===ch){if(this.input(),this.is_HEX())return this.consume_HNUM();this.unput(2)}else if("b"===ch||"B"===ch){if(ch=this.input(),"0"===ch||"1"===ch)return this.consume_BNUM();this.unput(2)}else this.is_NUM()||this.unput(1);for(;this.offset<this.size;)if(ch=this.input(),!this.is_NUM()){if("."!==ch||hasPoint){if("e"===ch||"E"===ch){if(ch=this.input(),"+"===ch||"-"===ch){if(ch=this.input(),this.is_NUM())return this.consume_LNUM(),this.tok.T_DNUMBER;ch&&this.unput(3);break}if(this.is_NUM())return this.consume_LNUM(),this.tok.T_DNUMBER;ch&&this.unput(2);break}this.unput(1);break}hasPoint=!0}return hasPoint?this.tok.T_DNUMBER:this.yytext.length<MAX_LENGTH_OF_LONG-1?this.tok.T_LNUMBER:this.yytext.length<MAX_LENGTH_OF_LONG||this.yytext.length==MAX_LENGTH_OF_LONG&&this.yytext<long_min_digits?this.tok.T_LNUMBER:this.tok.T_DNUMBER;
},consume_HNUM:function(){for(;this.offset<this.size;)if(this.input(),!this.is_HEX()){this.unput(1);break}return this.tok.T_LNUMBER},consume_LNUM:function(){for(;this.offset<this.size;)if(this.input(),!this.is_NUM()){this.unput(1);break}return this.tok.T_LNUMBER},consume_BNUM:function(){for(var ch;this.offset<this.size;)if(ch=this.input(),"0"!==ch&&"1"!==ch){ch&&this.unput(1);break}return this.tok.T_LNUMBER}}}).call(this,require("_process"))},{_process:1}],95:[function(require,module,exports){module.exports={matchST_LOOKING_FOR_PROPERTY:function(){var ch=this.input();if("-"===ch){if(ch=this.input(),">"===ch)return this.tok.T_OBJECT_OPERATOR;ch&&this.unput(1)}else if(this.is_LABEL_START())return this.consume_LABEL(),this.popState(),this.tok.T_STRING;return this.popState(),ch&&this.unput(1),!1},matchST_LOOKING_FOR_VARNAME:function(){var ch=this.input();return this.is_LABEL_START()?(this.consume_LABEL(),ch=this.input(),this.popState(),"["===ch||"}"===ch?(this.begin("ST_IN_SCRIPTING"),this.unput(1),this.tok.T_STRING_VARNAME):(this.unput(this.yytext.length),
!1)):(ch&&this.unput(1),this.popState(),this.begin("ST_IN_SCRIPTING"),!1)},matchST_VAR_OFFSET:function(){var ch=this.input();if(this.is_NUM())return this.consume_NUM(),this.tok.T_NUM_STRING;if("]"===ch)return this.popState(),"]";if("$"===ch){if(this.input(),this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_VARIABLE;throw new Error("Unexpected terminal")}if(this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_STRING;if(this.is_WHITESPACE()||"\\"===ch||"'"===ch||"#"===ch)return this.tok.T_ENCAPSED_AND_WHITESPACE;if("["===ch||"{"===ch||"}"===ch||'"'===ch||"`"===ch||this.is_TOKEN())return ch;throw new Error("Unexpected terminal")}}},{}],96:[function(require,module,exports){module.exports={matchST_IN_SCRIPTING:function(){var ch=this.input();switch(ch){case" ":case"\t":case"\n":case"\r":case"\r\n":return this.T_WHITESPACE();case"#":return this.T_COMMENT();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN();
case"'":return this.T_CONSTANT_ENCAPSED_STRING();case'"':return this.ST_DOUBLE_QUOTES();case"`":return this.begin("ST_BACKQUOTE"),"`";case"?":if(!this.aspTagMode&&this.tryMatch(">")){this.input();var nextCH=this._input[this.offset];return"\n"!==nextCH&&"\r"!==nextCH||this.input(),this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG}return this.consume_TOKEN();case"%":return this.aspTagMode&&">"===this._input[this.offset]?(this.input(),ch=this._input[this.offset],"\n"!==ch&&"\r"!==ch||this.input(),this.aspTagMode=!1,this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG):this.consume_TOKEN();case"{":return this.begin("ST_IN_SCRIPTING"),"{";case"}":return this.conditionStack.length>2&&this.popState(),"}";default:if("."===ch){if(ch=this.input(),this.is_NUM())return this.consume_NUM();ch&&this.unput(1)}if(this.is_NUM())return this.consume_NUM();if(this.is_LABEL_START())return this.consume_LABEL().T_STRING();if(this.is_TOKEN())return this.consume_TOKEN()}throw new Error('Bad terminal sequence "'+ch+'" at line '+this.yylineno+" (offset "+this.offset+")");
},T_WHITESPACE:function(){for(;this.offset<this.size;){var ch=this.input();if(" "!==ch&&"\t"!==ch&&"\n"!==ch&&"\r"!==ch){this.unput(1);break}}return this.tok.T_WHITESPACE}}},{}],97:[function(require,module,exports){module.exports={T_CONSTANT_ENCAPSED_STRING:function(){for(var ch;this.offset<this.size;)if(ch=this.input(),"\\"==ch)this.input();else if("'"==ch)break;return this.tok.T_CONSTANT_ENCAPSED_STRING},is_HEREDOC:function(){var revert=this.offset;if("<"===this._input[this.offset-1]&&"<"===this._input[this.offset]&&"<"===this._input[this.offset+1]){if(this.offset+=3,this.is_TABSPACE())for(;this.offset<this.size&&(this.offset++,this.is_TABSPACE()););var tChar=this._input[this.offset-1];if("'"===tChar||'"'===tChar?this.offset++:tChar=null,this.is_LABEL_START()){for(var yyoffset=this.offset-1;this.offset<this.size&&(this.offset++,this.is_LABEL()););var yylabel=this._input.substring(yyoffset,this.offset-1);if((!tChar||tChar===this._input[this.offset-1])&&(tChar&&this.offset++,"\r"===this._input[this.offset-1]||"\n"===this._input[this.offset-1]))return this.heredoc_label=yylabel,
yyoffset=this.offset-revert,this.offset=revert,this.consume(yyoffset),"'"===tChar?this.begin("ST_NOWDOC"):this.begin("ST_HEREDOC"),this.tok.T_START_HEREDOC}}return this.offset=revert,!1},ST_DOUBLE_QUOTES:function(){for(var ch;this.offset<this.size;)if(ch=this.input(),"\\"==ch)this.input();else{if('"'==ch)break;if("$"==ch){if(ch=this.input(),"{"==ch||this.is_LABEL_START()){this.unput(2);break}this.unput(1)}else if("{"==ch){if(ch=this.input(),"$"==ch){this.unput(2);break}this.unput(1)}}if('"'==ch)return this.tok.T_CONSTANT_ENCAPSED_STRING;var prefix=1;return"b"!==this.yytext[0]&&"B"!==this.yytext[0]||(prefix=2),this.yytext.length>2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-prefix),this.unput(this.yytext.length-prefix),this.begin("ST_DOUBLE_QUOTES"),this.yytext},isDOC_MATCH:function(){if(this._input.substring(this.offset-1,this.offset-1+this.heredoc_label.length)===this.heredoc_label){var ch=this._input[this.offset-1+this.heredoc_label.length];if("\n"===ch||"\r"===ch||";"===ch)return!0;
}return!1},matchST_NOWDOC:function(){if(this.isDOC_MATCH())return this.consume(this.heredoc_label.length),this.popState(),this.tok.T_END_HEREDOC;for(var ch=this._input[this.offset-1];this.offset<this.size;)if("\n"===ch||"\r"===ch){if(ch=this.input(),this.isDOC_MATCH())return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else ch=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_HEREDOC:function(){var ch=this.input();if(this.isDOC_MATCH())return this.consume(this.heredoc_label.length-1),this.popState(),this.tok.T_END_HEREDOC;for(;this.offset<this.size;)if("\\"===ch&&(ch=this.input(),"\n"!==ch&&"\r"!==ch&&(ch=this.input())),"\n"===ch||"\r"===ch){if(ch=this.input(),this.isDOC_MATCH())return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else if("$"===ch){if(ch=this.input(),"{"===ch)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),
this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var yyoffset=this.offset,next=this.consume_VARIABLE();return this.yytext.length>this.offset-yyoffset+2?(this.appendToken(next,this.offset-yyoffset+2),this.unput(this.offset-yyoffset+2),this.tok.T_ENCAPSED_AND_WHITESPACE):next}}else if("{"===ch){if(ch=this.input(),"$"===ch)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN)}else ch=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},consume_VARIABLE:function(){if(this.consume_LABEL(),ch=this.input(),"["==ch)return this.unput(1),this.begin("ST_VAR_OFFSET"),this.tok.T_VARIABLE;if("-"===ch){if(">"===this.input())return this.input(),this.is_LABEL_START()&&this.begin("ST_LOOKING_FOR_PROPERTY"),this.unput(3),this.tok.T_VARIABLE;this.unput(2)}else this.unput(1);return this.tok.T_VARIABLE},matchST_BACKQUOTE:function(){var ch=this.input();
if("$"===ch){if(ch=this.input(),"{"===ch)return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var tok=this.consume_VARIABLE();return tok}}else if("{"===ch){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if("`"===ch)return this.popState(),"`";for(;this.offset<this.size;){if("\\"===ch)this.input();else{if("`"===ch){this.unput(1),this.popState(),this.appendToken("`",1);break}if("$"===ch){if(ch=this.input(),"{"===ch)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var yyoffset=this.offset,next=this.consume_VARIABLE();return this.yytext.length>this.offset-yyoffset+2?(this.appendToken(next,this.offset-yyoffset+2),this.unput(this.offset-yyoffset+2),this.tok.T_ENCAPSED_AND_WHITESPACE):next}this.unput(1)}else if("{"===ch){if(ch=this.input(),
"$"===ch)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);this.unput(1)}}ch=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_DOUBLE_QUOTES:function(){var ch=this.input();if("$"===ch){if(ch=this.input(),"{"===ch)return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var tok=this.consume_VARIABLE();return tok}}else if("{"===ch){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if('"'===ch)return this.popState(),'"';for(;this.offset<this.size;){if("\\"===ch)this.input();else{if('"'===ch){this.unput(1),this.popState(),this.appendToken('"',1);break}if("$"===ch){if(ch=this.input(),"{"===ch)return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;
if(this.is_LABEL_START()){var yyoffset=this.offset,next=this.consume_VARIABLE();return this.yytext.length>this.offset-yyoffset+2?(this.appendToken(next,this.offset-yyoffset+2),this.unput(this.offset-yyoffset+2),this.tok.T_ENCAPSED_AND_WHITESPACE):next}this.unput(1)}else if("{"===ch){if(ch=this.input(),"$"===ch)return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);ch&&this.unput(1)}}ch=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE}}},{}],98:[function(require,module,exports){module.exports={T_STRING:function(){var token=this.yytext.toLowerCase(),id=this.keywords[token];if(!id)if("yield"===token)this.tryMatch(" from")?(this.consume(5),id=this.tok.T_YIELD_FROM):id=this.tok.T_YIELD;else if(id=this.tok.T_STRING,"b"===token||"B"===token){var ch=this.input(1);if('"'===ch)return this.ST_DOUBLE_QUOTES();if("'"===ch)return this.T_CONSTANT_ENCAPSED_STRING();ch&&this.unput(1)}return id;
},consume_TOKEN:function(){var ch=this._input[this.offset-1],fn=this.tokenTerminals[ch];return fn?fn.apply(this,[]):this.yytext},tokenTerminals:{$:function(){return this.offset++,this.is_LABEL_START()?(this.offset--,this.consume_LABEL(),this.tok.T_VARIABLE):(this.offset--,"$")},"-":function(){var nchar=this._input[this.offset];return">"===nchar?(this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_OBJECT_OPERATOR):"-"===nchar?(this.input(),this.tok.T_DEC):"="===nchar?(this.input(),this.tok.T_MINUS_EQUAL):"-"},"\\":function(){return this.tok.T_NS_SEPARATOR},"/":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_DIV_EQUAL):"/"},":":function(){return":"===this._input[this.offset]?(this.input(),this.tok.T_DOUBLE_COLON):":"},"(":function(){var initial=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){var yylen=this.yytext.length;this.consume_LABEL();var castToken=this.yytext.substring(yylen-1).toLowerCase(),castId=this.castKeywords[castToken];
if(castId&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return castId}return this.unput(this.offset-initial),"("},"=":function(){var nchar=this._input[this.offset];return">"===nchar?(this.input(),this.tok.T_DOUBLE_ARROW):"="===nchar?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_IDENTICAL):(this.input(),this.tok.T_IS_EQUAL):"="},"+":function(){var nchar=this._input[this.offset];return"+"===nchar?(this.input(),this.tok.T_INC):"="===nchar?(this.input(),this.tok.T_PLUS_EQUAL):"+"},"!":function(){return"="===this._input[this.offset]?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_NOT_IDENTICAL):(this.input(),this.tok.T_IS_NOT_EQUAL):"!"},"?":function(){return"?"===this._input[this.offset]?(this.input(),this.tok.T_COALESCE):"?"},"<":function(){var nchar=this._input[this.offset];return"<"===nchar?(nchar=this._input[this.offset+1],"="===nchar?(this.consume(2),this.tok.T_SL_EQUAL):"<"===nchar&&this.is_HEREDOC()?this.tok.T_START_HEREDOC:(this.input(),
this.tok.T_SL)):"="===nchar?(this.input(),">"===this._input[this.offset]?(this.input(),this.tok.T_SPACESHIP):this.tok.T_IS_SMALLER_OR_EQUAL):">"===nchar?(this.input(),this.tok.T_IS_NOT_EQUAL):"<"},">":function(){var nchar=this._input[this.offset];return"="===nchar?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):">"===nchar?(nchar=this._input[this.offset+1],"="===nchar?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR)):">"},"*":function(){var nchar=this._input[this.offset];return"="===nchar?(this.input(),this.tok.T_MUL_EQUAL):"*"===nchar?(this.input(),"="===this._input[this.offset]?(this.input(),this.tok.T_POW_EQUAL):this.tok.T_POW):"*"},".":function(){var nchar=this._input[this.offset];return"="===nchar?(this.input(),this.tok.T_CONCAT_EQUAL):"."===nchar&&"."===this._input[this.offset+1]?(this.consume(2),this.tok.T_ELLIPSIS):"."},"%":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_MOD_EQUAL):"%"},"&":function(){var nchar=this._input[this.offset];return"="===nchar?(this.input(),
this.tok.T_AND_EQUAL):"&"===nchar?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function(){var nchar=this._input[this.offset];return"="===nchar?(this.input(),this.tok.T_OR_EQUAL):"|"===nchar?(this.input(),this.tok.T_BOOLEAN_OR):"|"},"^":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_XOR_EQUAL):"^"}}}},{}],99:[function(require,module,exports){var tokens=";:,.\\[]()|^&+-/*=%!~$<>?@";module.exports={is_NUM:function(){var ch=this._input.charCodeAt(this.offset-1);return ch>47&&ch<58},is_LABEL:function(){var ch=this._input.charCodeAt(this.offset-1);return ch>96&&ch<123||ch>64&&ch<91||95===ch||ch>47&&ch<58||ch>126},is_LABEL_START:function(){var ch=this._input.charCodeAt(this.offset-1);return ch>96&&ch<123||ch>64&&ch<91||95===ch||ch>126},consume_LABEL:function(){for(;this.offset<this.size;)if(this.input(),!this.is_LABEL()){this.unput(1);break}return this},is_TOKEN:function(){var ch=this._input[this.offset-1];return tokens.indexOf(ch)!==-1},is_WHITESPACE:function(){var ch=this._input[this.offset-1];
return" "===ch||"\t"===ch||"\n"===ch||"\r"===ch},is_TABSPACE:function(){var ch=this._input[this.offset-1];return" "===ch||"\t"===ch},consume_TABSPACE:function(){for(;this.offset<this.size;)if(this.input(),!this.is_TABSPACE()){this.unput(1);break}return this},is_HEX:function(){var ch=this._input.charCodeAt(this.offset-1);return ch>47&&ch<58||ch>64&&ch<71||ch>96&&ch<103}}},{}],100:[function(require,module,exports){function isNumber(n){return"."!=n&&","!=n&&!isNaN(parseFloat(n))&&isFinite(n)}var parser=function(lexer,ast){this.lexer=lexer,this.ast=ast,this.tok=lexer.tok,this.EOF=lexer.EOF,this.token=null,this.prev=null,this.debug=!1,this.extractDoc=!1,this.suppressErrors=!1,this.entries={VARIABLE:[this.tok.T_VARIABLE,"$","&",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAMESPACE,this.tok.T_STATIC],SCALAR:[this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR],
T_MAGIC_CONST:[this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C],T_MEMBER_FLAGS:[this.tok.T_PUBLIC,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_STATIC,this.tok.T_ABSTRACT,this.tok.T_FINAL],EOS:[";",this.tok.T_CLOSE_TAG,this.EOF,this.tok.T_INLINE_HTML],EXPR:["@","-","+","!","~","(","`",this.tok.T_LIST,this.tok.T_CLONE,this.tok.T_INC,this.tok.T_DEC,this.tok.T_NEW,this.tok.T_ISSET,this.tok.T_EMPTY,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_EVAL,this.tok.T_INT_CAST,this.tok.T_DOUBLE_CAST,this.tok.T_STRING_CAST,this.tok.T_ARRAY_CAST,this.tok.T_OBJECT_CAST,this.tok.T_BOOL_CAST,this.tok.T_UNSET_CAST,this.tok.T_EXIT,this.tok.T_PRINT,this.tok.T_YIELD,this.tok.T_STATIC,this.tok.T_FUNCTION,this.tok.T_VARIABLE,"$",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_STRING,this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C]
}};parser.prototype.getTokenName=function(token){return isNumber(token)?token==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[token]:"'"+token+"'"},parser.prototype.parse=function(code,filename){this._errors=[],this.filename=filename||"eval",this.currentNamespace=[""],this.lexer.setInput(code),this.lexer.comment_tokens=this.extractDoc,this.length=this.lexer._input.length,this.innerList=!1;var program=this.ast.prepare("program",this),childs=[];for(this.nextWithComments();this.token!=this.EOF;){var node=this.read_start();null!==node&&void 0!==node&&(Array.isArray(node)?childs=childs.concat(node):childs.push(node))}return program(childs,this._errors)},parser.prototype.raiseError=function(message,msgExpect,expect,token){if(message+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){var err=new SyntaxError(message,this.filename,this.lexer.yylloc.first_line);throw err.lineNumber=this.lexer.yylloc.first_line,err.fileName=this.filename,err.columnNumber=this.lexer.yylloc.first_column,err}var node=this.ast.prepare("error",this)(message,token,this.lexer.yylloc.first_line,expect);
return this._errors.push(node),node},parser.prototype.error=function(expect){var msg="Parse Error : syntax error";if(token=this.getTokenName(this.token),this.token!==this.EOF){if(isNumber(this.token)){var symbol=this.text();symbol.length>10&&(symbol=symbol.substring(0,7)+"..."),token="'"+symbol+"' ("+token+")"}msg+=", unexpected "+token}var msgExpect="";return expect&&!Array.isArray(expect)&&((isNumber(expect)||1===expect.length)&&(msgExpect=", expecting "+this.getTokenName(expect)),msg+=msgExpect),this.token!==this.EOF,this.raiseError(msg,msgExpect,expect,token)},parser.prototype.node=function(name){return this.ast.prepare(name,this)},parser.prototype.expectEndOfStatement=function(){if(";"===this.token)this.nextWithComments(),this.token===this.tok.T_CLOSE_TAG&&this.nextWithComments();else if(this.token===this.tok.T_CLOSE_TAG)this.nextWithComments();else if(this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF)return this.error(";"),!1;return!0};var ignoreStack=["parser.next","parser.ignoreComments","parser.nextWithComments"];
parser.prototype.showlog=function(){for(var line,stack=(new Error).stack.split("\n"),offset=2;offset<stack.length;offset++){line=stack[offset].trim();for(var found=!1,i=0;i<ignoreStack.length;i++)if(line.substring(3,3+ignoreStack[i].length)===ignoreStack[i]){found=!0;break}if(!found)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @-->"+line),this},parser.prototype.expect=function(token){if(Array.isArray(token)){if(token.indexOf(this.token)===-1)return this.error(token),!1}else if(this.token!=token)return this.error(token),!1;return!0},parser.prototype.text=function(){return this.lexer.yytext},parser.prototype.next=function(){return this.debug?(this.showlog(),this.debug=!1,this.nextWithComments().ignoreComments(),this.debug=!0):this.nextWithComments().ignoreComments(),this},parser.prototype.ignoreComments=function(){for(this.debug&&this.showlog();this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT;)this.nextWithComments();
return this},parser.prototype.nextWithComments=function(){return this.prev=[this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.offset],this.token=this.lexer.lex()||this.EOF,this.debug&&this.showlog(),this},parser.prototype.is=function(type){return Array.isArray(type)?type.indexOf(this.token)!==-1:this.entries[type].indexOf(this.token)!=-1},[require("./parser/array.js"),require("./parser/class.js"),require("./parser/comment.js"),require("./parser/expr.js"),require("./parser/function.js"),require("./parser/if.js"),require("./parser/loops.js"),require("./parser/main.js"),require("./parser/namespace.js"),require("./parser/scalar.js"),require("./parser/statement.js"),require("./parser/switch.js"),require("./parser/try.js"),require("./parser/utils.js"),require("./parser/variable.js")].forEach(function(ext){for(var k in ext)parser.prototype[k]=ext[k]}),module.exports=parser},{"./parser/array.js":101,"./parser/class.js":102,"./parser/comment.js":103,"./parser/expr.js":104,"./parser/function.js":105,
"./parser/if.js":106,"./parser/loops.js":107,"./parser/main.js":108,"./parser/namespace.js":109,"./parser/scalar.js":110,"./parser/statement.js":111,"./parser/switch.js":112,"./parser/try.js":113,"./parser/utils.js":114,"./parser/variable.js":115}],101:[function(require,module,exports){var ArrayExpr="array",ArrayEntry="entry";module.exports={read_array:function(){var expect=null,shortForm=!1,items=[],result=this.node(ArrayExpr);if(this.token===this.tok.T_ARRAY?(this.next().expect("("),expect=")"):(shortForm=!0,expect="]"),this.next().token!=expect)for(;this.token!=this.EOF&&(items.push(this.read_array_pair_list()),","==this.token)&&(this.next(),this.token!==expect););return this.expect(expect),this.next(),result(shortForm,items)},read_array_pair_list:function(){var result=this.node(ArrayEntry),key=null,value=null;if("&"===this.token)value=this.next().read_variable(!0,!1,!0);else{var expr=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(key=expr,value="&"===this.next().token?this.next().read_variable(!0,!1,!0):this.read_expr()):value=expr;
}return result(key,value)},read_dim_offset:function(){return"]"!=this.token&&this.read_expr()}}},{}],102:[function(require,module,exports){module.exports={read_class:function(flag){var result=this.node("class");this.expect(this.tok.T_CLASS),this.next().expect(this.tok.T_STRING);var body,propName=this.text(),propExtends=null,propImplements=null;return this.next().token==this.tok.T_EXTENDS&&(propExtends=this.next().read_namespace_name()),this.token==this.tok.T_IMPLEMENTS&&(propImplements=this.next().read_name_list()),this.expect("{"),body=this.nextWithComments().read_class_body(),result(propName,propExtends,propImplements,body,flag)},read_class_scope:function(){var result=this.token;return result==this.tok.T_FINAL?(this.next(),[0,0,2]):result==this.tok.T_ABSTRACT?(this.next(),[0,0,1]):[0,0,0]},read_class_body:function(){for(var result=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT)if(this.token!==this.tok.T_USE){var flags=this.read_member_flags(!1);
if(this.token!==this.tok.T_CONST)if(this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),flags[0]=flags[1]=0),this.token===this.tok.T_VARIABLE){var variables=this.read_variable_list(flags);this.expect(";"),this.nextWithComments(),result=result.concat(variables)}else this.token===this.tok.T_FUNCTION?result.push(this.read_function(!1,flags)):(this.error([this.tok.T_CONST,this.tok.T_VARIABLE,this.tok.T_FUNCTION]),this.next());else{var constants=this.read_constant_list(flags);this.expect(";"),this.nextWithComments(),result=result.concat(constants)}}else result=result.concat(this.next().read_trait_use_statement());else result.push(this.read_doc_comment());else result.push(this.read_comment());return this.expect("}"),this.nextWithComments(),result},read_variable_list:function(flags){return this.read_list(function read_variable_declaration(){var result=this.node("property");this.expect(this.tok.T_VARIABLE);var name=this.text().substring(1);return this.next(),";"===this.token||","===this.token?result(name,null,flags):"="===this.token?result(name,this.next().read_expr(),flags):(this.expect([",",";","="]),
result(name,null,flags))},",")},read_constant_list:function(flags){return this.expect(this.tok.T_CONST)&&this.next(),this.read_list(function read_constant_declaration(){var result=this.node("classconstant"),name=null,value=null;return this.expect(this.tok.T_STRING)&&(name=this.text(),this.next()),this.expect("=")&&(value=this.next().read_expr()),result(name,value,flags)},",")},read_member_flags:function(asInterface){var result=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){var idx=0,val=0;do{switch(this.token){case this.tok.T_PUBLIC:idx=0,val=0;break;case this.tok.T_PROTECTED:idx=0,val=1;break;case this.tok.T_PRIVATE:idx=0,val=2;break;case this.tok.T_STATIC:idx=1,val=1;break;case this.tok.T_ABSTRACT:idx=2,val=1;break;case this.tok.T_FINAL:idx=2,val=2}asInterface&&(0==idx&&2==val?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),val=-1):2==idx&&1==val&&(this.error(),val=-1)),result[idx]!==-1?this.error():val!==-1&&(result[idx]=val)}while(this.next().is("T_MEMBER_FLAGS"))}return result[0]==-1&&(result[0]=0),result[1]==-1&&(result[1]=0),
result[2]==-1&&(result[2]=0),result},read_interface:function(){var result=this.node("interface"),name=null,body=null,propExtends=null;return this.expect(this.tok.T_INTERFACE)&&this.next(),this.expect(this.tok.T_STRING)&&(name=this.text(),this.next()),this.token===this.tok.T_EXTENDS&&(propExtends=this.next().read_name_list()),this.expect("{")&&(body=this.next().read_interface_body()),result(name,propExtends,body)},read_interface_body:function(){for(var result=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT){var flags=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){var constants=this.read_constant_list(flags);this.expect(";")&&this.nextWithComments(),result=result.concat(constants)}else if(this.token===this.tok.T_FUNCTION){var method=this.read_function_declaration(2,flags);method.parseFlags(flags),result.push(method),this.expect(";")&&this.nextWithComments()}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}else result.push(this.read_doc_comment());else result.push(this.read_comment());
return this.expect("}")&&this.next(),result},read_trait:function(flag){var result=this.node("trait"),propName=null,propExtends=null,propImplements=null,body=null;return this.expect(this.tok.T_TRAIT)&&this.next(),this.expect(this.tok.T_STRING)&&(propName=this.text()),this.next().token==this.tok.T_EXTENDS&&(propExtends=this.next().read_namespace_name()),this.token==this.tok.T_IMPLEMENTS&&(propImplements=this.next().read_name_list()),this.expect("{")&&(body=this.next().read_class_body()),result(propName,propExtends,propImplements,body)},read_trait_use_statement:function(){for(var node=this.node("traituse"),traits=[this.read_namespace_name()],adaptations=null;","===this.token;)traits.push(this.next().read_namespace_name());if("{"===this.token){for(adaptations=[];this.next().token!==this.EOF&&"}"!==this.token;)adaptations.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.nextWithComments()}else this.expect(";")&&this.nextWithComments();return node(traits,adaptations)},read_trait_use_alias:function(){
var node=this.node(),trait=null,method=this.read_namespace_name();if(this.token===this.tok.T_DOUBLE_COLON?this.next().expect(this.tok.T_STRING)&&(trait=method,method=this.text(),this.next()):method=method.name,this.token===this.tok.T_INSTEADOF)return node("traitprecedence",trait,method,this.next().read_name_list());if(this.token===this.tok.T_AS){var flags=!1,alias=null;return this.next().is("T_MEMBER_FLAGS")&&(flags=this.read_member_flags()),this.token===this.tok.T_STRING?(alias=this.text(),this.next()):flags===!1&&this.expect(this.tok.T_STRING),node("traitalias",trait,method,alias,flags)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),node("traitalias",trait,method,null,null)}}},{}],103:[function(require,module,exports){var docSplit=/^(\s*\*[ \t]*|[ \t]*)(.*)$/gm;module.exports={read_comment:function(){var result=this.node("doc"),lines=[];do{var line=this.text();"#"===line[0]?line=line.substring(1):(line=line.substring(2),"*/"===line.substring(line.length-2)&&(line=line.substring(0,line.length-2))),lines.push(line.trim());
}while(this.nextWithComments().token===this.tok.T_COMMENT);return result(!1,lines)},read_doc_comment:function(){var result=this.node("doc"),text=this.text();text=text.substring(2,text.length-2);var lines=[];text=text.split(docSplit);for(var i=2;i<text.length;i+=3)lines.push(text[i].trim());return this.nextWithComments(),result(!0,lines)}}},{}],104:[function(require,module,exports){"use strict";module.exports={read_expr:function(){var result=this.node(),expr=this.read_expr_item();if("|"===this.token)return result("bin","|",expr,this.next().read_expr());if("&"===this.token)return result("bin","&",expr,this.next().read_expr());if("^"===this.token)return result("bin","^",expr,this.next().read_expr());if("."===this.token)return result("bin",".",expr,this.next().read_expr());if("+"===this.token)return result("bin","+",expr,this.next().read_expr());if("-"===this.token)return result("bin","-",expr,this.next().read_expr());if("*"===this.token)return result("bin","*",expr,this.next().read_expr());if("/"===this.token)return result("bin","/",expr,this.next().read_expr());
if("%"===this.token)return result("bin","%",expr,this.next().read_expr());if(this.token===this.tok.T_POW)return result("bin","**",expr,this.next().read_expr());if(this.token===this.tok.T_SL)return result("bin","<<",expr,this.next().read_expr());if(this.token===this.tok.T_SR)return result("bin",">>",expr,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_OR)return result("bin","||",expr,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_OR)return result("bin","or",expr,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_AND)return result("bin","&&",expr,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_AND)return result("bin","and",expr,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_XOR)return result("bin","xor",expr,this.next().read_expr());if(this.token===this.tok.T_IS_IDENTICAL)return result("bin","===",expr,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_IDENTICAL)return result("bin","!==",expr,this.next().read_expr());if(this.token===this.tok.T_IS_EQUAL)return result("bin","==",expr,this.next().read_expr());
if(this.token===this.tok.T_IS_NOT_EQUAL)return result("bin","!=",expr,this.next().read_expr());if("<"===this.token)return result("bin","<",expr,this.next().read_expr());if(">"===this.token)return result("bin",">",expr,this.next().read_expr());if(this.token===this.tok.T_IS_SMALLER_OR_EQUAL)return result("bin","<=",expr,this.next().read_expr());if(this.token===this.tok.T_IS_GREATER_OR_EQUAL)return result("bin",">=",expr,this.next().read_expr());if(this.token===this.tok.T_SPACESHIP)return result("bin","<=>",expr,this.next().read_expr());if(this.token===this.tok.T_INSTANCEOF)return result("bin","instanceof",expr,this.next().read_expr());if(this.token===this.tok.T_COALESCE)return result("bin","??",expr,this.next().read_expr());if("?"===this.token){var trueArg=null;return":"!==this.next().token&&(trueArg=this.read_expr()),this.expect(":")&&this.next(),result("retif",expr,trueArg,this.read_expr())}return expr},read_expr_item:function(){if("@"===this.token)return this.node("silent")(this.next().read_expr());if("+"===this.token)return this.node("unary")("+",this.next().read_expr());
if("!"===this.token)return this.node("unary")("!",this.next().read_expr());if("~"===this.token)return this.node("unary")("~",this.next().read_expr());if("-"===this.token){var result=this.node();return this.next(),this.token===this.tok.T_LNUMBER||this.token===this.tok.T_DNUMBER?(result=result("number","-"+this.text()),this.next(),result):result("unary","-",this.read_expr())}if("("===this.token){var node=this.node("parenthesis"),expr=this.next().read_expr();return this.expect(")")&&this.next(),expr=node(expr),this.token===this.tok.T_OBJECT_OPERATOR?this.recursive_variable_chain_scan(expr,!1):this.token===this.tok.T_CURLY_OPEN||"["===this.token?this.read_dereferencable(expr):"("===this.token?this.node("call")(expr,this.read_function_argument_list()):expr}if("`"===this.token)return this.next().read_encapsed_string("`");if(this.token===this.tok.T_LIST){var result=this.node("list"),assign=null,isInner=this.innerList;isInner||(assign=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);
for(var assignList=this.read_assignment_list(),hasItem=!1,i=0;i<assignList.length;i++)if(null!==assignList[i]){hasItem=!0;break}return hasItem||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),this.expect(")")&&this.next(),isInner?result(assignList):(this.innerList=!1,this.expect("=")?assign(result(assignList),this.next().read_expr(),"="):result(assignList))}if(this.token===this.tok.T_CLONE)return this.node("clone")(this.next().read_expr());switch(this.token){case this.tok.T_INC:return this.node("pre")("+",this.next().read_variable(!1,!1,!1));case this.tok.T_DEC:return this.node("pre")("-",this.next().read_variable(!1,!1,!1));case this.tok.T_NEW:return this.next().read_new_expr();case this.tok.T_ISSET:var result=this.node("isset");this.next().expect("(")&&this.next();var args=this.read_list(this.read_expr,",");return this.expect(")")&&this.next(),result(args);case this.tok.T_EMPTY:var result=this.node("empty");this.next().expect("(")&&this.next();var arg=this.read_expr();
return this.expect(")")&&this.next(),result([arg]);case this.tok.T_INCLUDE:return this.node("include")(!1,!1,this.next().read_expr());case this.tok.T_INCLUDE_ONCE:return this.node("include")(!0,!1,this.next().read_expr());case this.tok.T_REQUIRE:return this.node("include")(!1,!0,this.next().read_expr());case this.tok.T_REQUIRE_ONCE:return this.node("include")(!0,!0,this.next().read_expr());case this.tok.T_EVAL:var result=this.node("eval");this.next().expect("(")&&this.next();var expr=this.read_expr();return this.expect(")")&&this.next(),result(expr);case this.tok.T_INT_CAST:return this.node("cast")("int",this.next().read_expr());case this.tok.T_DOUBLE_CAST:return this.node("cast")("double",this.next().read_expr());case this.tok.T_STRING_CAST:return this.node("cast")("string",this.next().read_expr());case this.tok.T_ARRAY_CAST:return this.node("cast")("array",this.next().read_expr());case this.tok.T_OBJECT_CAST:return this.node("cast")("object",this.next().read_expr());case this.tok.T_BOOL_CAST:return this.node("cast")("boolean",this.next().read_expr());
case this.tok.T_UNSET_CAST:return this.node("unset")(this.next().read_expr());case this.tok.T_EXIT:var result=this.node("exit"),status=null;return"("===this.next().token&&(")"!==this.next().token?(status=this.read_expr(),this.expect(")")&&this.next()):this.next()),result(status);case this.tok.T_PRINT:return this.node("print")(this.next().read_expr());case this.tok.T_YIELD:var result=this.node("yield"),value=null,key=null;return this.next().is("EXPR")&&(value=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(key=value,value=this.next().read_expr())),result(value,key);case this.tok.T_YIELD_FROM:var result=this.node("yieldfrom"),expr=this.next().read_expr();return result(expr);case this.tok.T_FUNCTION:return this.read_function(!0);case this.tok.T_STATIC:var backup=[this.token,this.lexer.getState()];if(this.next().token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);this.lexer.tokens.push(backup),this.next()}var expr;if(this.is("VARIABLE")){var result=this.node();expr=this.read_variable(!1,!1,!1);
var isConst="constref"===expr.kind||"staticlookup"===expr.kind&&"constref"===expr.offset.kind;switch(this.token){case"=":isConst&&this.error("VARIABLE");var right;return right="&"==this.next().token?this.next().token===this.tok.T_NEW?this.next().read_new_expr():this.read_variable(!1,!1,!0):this.read_expr(),result("assign",expr,right,"=");case this.tok.T_PLUS_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),".=");
case this.tok.T_MOD_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return isConst&&this.error("VARIABLE"),result("assign",expr,this.next().read_expr(),">>=");case this.tok.T_INC:return isConst&&this.error("VARIABLE"),this.next(),result("post","+",expr);case this.tok.T_DEC:return isConst&&this.error("VARIABLE"),this.next(),result("post","-",expr)}}else if(this.is("SCALAR"))for(expr=this.read_scalar();this.token!==this.EOF;)if(this.token===this.tok.T_OBJECT_OPERATOR)expr=this.recursive_variable_chain_scan(expr,!1);else if(this.token===this.tok.T_CURLY_OPEN||"["===this.token)expr=this.read_dereferencable(expr);else{
if("("!==this.token)return expr;expr=this.node("call")(expr,this.read_function_argument_list())}else this.error("EXPR"),this.next();return expr},read_new_expr:function(){var result=this.node("new");if(this.token===this.tok.T_CLASS){var what=this.node("class"),propExtends=null,propImplements=null,body=null,args=[];return"("===this.next().token&&(args=this.read_function_argument_list()),this.token==this.tok.T_EXTENDS&&(propExtends=this.next().read_namespace_name()),this.token==this.tok.T_IMPLEMENTS&&(propImplements=this.next().read_name_list()),this.expect("{")&&(body=this.next().read_class_body()),result(what(null,propExtends,propImplements,body,[0,0,0]),args)}var name=this.read_class_name_reference(),args=[];return"("===this.token&&(args=this.read_function_argument_list()),result(name,args)},read_class_name_reference:function(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){var result=this.read_namespace_name();return this.token===this.tok.T_DOUBLE_COLON&&(result=this.read_static_getter(result)),
result}return this.is("VARIABLE")?this.read_variable(!0,!1,!1):void this.expect([this.tok.T_STRING,"VARIABLE"])},read_assignment_list:function(){return this.read_list(this.read_assignment_list_element,",")},read_assignment_list_element:function(){if(","===this.token||")"===this.token)return null;var result=this.read_expr_item();return this.token===this.tok.T_DOUBLE_ARROW&&(result=["key",result,this.next().read_expr_item()]),result}}},{}],105:[function(require,module,exports){module.exports={is_reference:function(){return"&"==this.token&&(this.next(),!0)},is_variadic:function(){return this.token===this.tok.T_ELLIPSIS&&(this.next(),!0)},read_function:function(closure,flag){var result=this.read_function_declaration(closure?1:flag?2:0,flag&&1===flag[1]);return flag&&1==flag[2]?(result.parseFlags(flag),this.expect(";")&&this.nextWithComments()):(this.expect("{")&&(result.body=this.read_code_block(!1),result.loc&&result.body.loc&&(result.loc.end=result.body.loc.end)),!closure&&flag&&result.parseFlags(flag)),result},
read_function_declaration:function(type,isStatic){var nodeName="function";1===type?nodeName="closure":2===type&&(nodeName="method");var result=this.node(nodeName);this.expect(this.tok.T_FUNCTION)&&this.next();var isRef=this.is_reference(),name=!1,use=[],returnType=null,nullable=!1;1!==type&&this.expect(this.tok.T_STRING)&&(name=this.text(),this.next()),this.expect("(")&&this.next();var params=this.read_parameter_list();return this.expect(")")&&this.next(),1===type&&this.token===this.tok.T_USE&&(this.next().expect("(")&&this.next(),use=this.read_list(this.read_lexical_var,","),this.expect(")")&&this.next()),":"===this.token&&("?"===this.next().token&&(nullable=!0,this.next()),returnType=this.read_type()),1===type?result(params,isRef,use,returnType,nullable,isStatic):result(name,params,isRef,returnType,nullable)},read_lexical_var:function(){var result=this.node("variable"),isRef=!1;"&"===this.token&&(isRef=!0,this.next()),this.expect(this.tok.T_VARIABLE);var name=this.text().substring(1);return this.next(),result(name,isRef,!1);
},read_parameter_list:function(){var result=[];if(")"!=this.token)for(;this.token!=this.EOF;){if(result.push(this.read_parameter()),","!=this.token){if(")"==this.token)break;this.error([",",")"]);break}this.next()}return result},read_parameter:function(){var node=this.node("parameter"),name=null,value=null,type=null,nullable=!1;"?"===this.token&&(this.next(),nullable=!0),type=this.read_type(),nullable&&!type&&this.raiseError("Expecting a type definition combined with nullable operator");var isRef=this.is_reference(),isVariadic=this.is_variadic();return this.expect(this.tok.T_VARIABLE)&&(name=this.text().substring(1),this.next()),"="==this.token&&(value=this.next().read_expr()),node(name,type,value,isRef,isVariadic,nullable)},read_function_argument_list:function(){var result=[],wasVariadic=!1;if(this.expect("(")&&this.next(),")"!==this.token)for(;this.token!=this.EOF;){var argument=this.read_argument_list();if(argument&&(result.push(argument),"variadic"===argument.kind?wasVariadic=!0:wasVariadic&&this.raiseError("Unexpected argument after a variadic argument")),
","!==this.token)break;this.next()}return this.expect(")")&&this.next(),result},read_argument_list:function(){return this.token===this.tok.T_ELLIPSIS?this.node("variadic")(this.next().read_expr()):this.read_expr()},read_type:function(){var result=this.node("identifier");switch(this.token){case this.tok.T_ARRAY:return this.next(),result(["","array"],!1);case this.tok.T_NAMESPACE:case this.tok.T_NS_SEPARATOR:case this.tok.T_STRING:return this.read_namespace_name();case this.tok.T_CALLABLE:return this.next(),result(["","callable"],!1);default:return null}}}},{}],106:[function(require,module,exports){module.exports={read_if:function(){var result=this.node("if"),body=null,alternate=null,shortForm=!1,test=null;if(test=this.read_if_expr(),":"===this.token){shortForm=!0,this.next(),body=this.node("block");for(var items=[];this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){alternate=this.next().read_elseif_short();break}if(this.token===this.tok.T_ELSE){alternate=this.next().read_else_short();
break}items.push(this.read_inner_statement())}body=body(null,items),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else body=this.read_statement(),this.ignoreComments(),this.token===this.tok.T_ELSEIF?alternate=this.next().read_if():this.token===this.tok.T_ELSE&&(alternate=this.next().read_statement());return result(test,body,alternate,shortForm)},read_if_expr:function(){this.expect("(")&&this.next();var result=this.read_expr();return this.expect(")")&&this.next(),result},read_elseif_short:function(){var result=this.node("if"),alternate=null,test=null,body=null,items=[];for(test=this.read_if_expr(),this.expect(":")&&this.next(),body=this.node("block");this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){alternate=this.next().read_elseif_short();break}if(this.token===this.tok.T_ELSE){alternate=this.next().read_else_short();break}items.push(this.read_inner_statement())}return body=body(null,items),result(test,body,alternate,!0)},read_else_short:function(){
this.expect(":")&&this.next();for(var body=this.node("block"),items=[];this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)items.push(this.read_inner_statement());return body(null,items)}}},{}],107:[function(require,module,exports){"use strict";module.exports={read_while:function(){var result=this.node("while"),test=null,body=null,shortForm=!1;return this.expect("(")&&this.next(),test=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(shortForm=!0,body=this.read_short_form(this.tok.T_ENDWHILE)):body=this.read_statement(),result(test,body,shortForm)},read_do:function(){var result=this.node("do"),test=null,body=null;return body=this.read_statement(),this.ignoreComments().expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),test=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),result(test,body)},read_for:function(){var result=this.node("for"),init=[],test=[],increment=[],body=null,shortForm=!1;return this.expect("(")&&this.next(),";"!==this.token?(init=this.read_list(this.read_expr,","),
this.expect(";")&&this.next()):this.next(),";"!==this.token?(test=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),")"!==this.token?(increment=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),":"===this.token?(shortForm=!0,body=this.read_short_form(this.tok.T_ENDFOR)):body=this.read_statement(),result(init,test,increment,body,shortForm)},read_foreach:function(){var result=this.node("foreach"),source=null,key=null,value=null,body=null,shortForm=!1;return this.expect("(")&&this.next(),source=this.read_expr(),this.ignoreComments().expect(this.tok.T_AS)&&(this.next(),value=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(key=value,value=this.next().read_foreach_variable())),this.expect(")")&&this.next(),":"===this.token?(shortForm=!0,body=this.read_short_form(this.tok.T_ENDFOREACH)):body=this.read_statement(),result(source,key,value,body,shortForm)},read_foreach_variable:function(){if(this.token===this.tok.T_LIST){var result=this.node("list");
this.next().expect("(")&&this.next();var assignList=this.read_assignment_list();return this.expect(")")&&this.next(),result(assignList)}return"["===this.token||this.token===this.tok.T_ARRAY?this.read_array():this.read_variable(!1,!1,!1)}}},{}],108:[function(require,module,exports){module.exports={read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}}},{}],109:[function(require,module,exports){"use strict";module.exports={read_namespace:function(){var result=this.node("namespace");if(this.expect(this.tok.T_NAMESPACE)&&this.next(),"{"==this.token){this.currentNamespace=[""];var body=this.nextWithComments().read_top_statements();return this.expect("}")&&this.nextWithComments(),result([""],body,!0)}var name=this.read_namespace_name();if(";"==this.token){this.currentNamespace=name;var body=this.nextWithComments().read_top_statements();return this.expect(this.EOF),result(name.name,body,!1)}if("{"==this.token){this.currentNamespace=name;var body=this.nextWithComments().read_top_statements();
return this.expect("}")&&this.nextWithComments(),result(name.name,body,!0)}if("("===this.token)return name.resolution=this.ast.identifier.RELATIVE_NAME,name.name=name.name.substring(1),this.node("call")(name,this.read_function_argument_list());this.error(["{",";"]),this.currentNamespace=name;var body=this.read_top_statements();return this.expect(this.EOF),result(name,body,!1)},read_namespace_name:function(){var result=this.node("identifier"),relative=!1;return this.token===this.tok.T_NAMESPACE&&(this.next().expect(this.tok.T_NS_SEPARATOR)&&this.next(),relative=!0),result(this.read_list(this.tok.T_STRING,this.tok.T_NS_SEPARATOR,!0),relative)},read_use_statement:function(){var result=this.node("usegroup"),type=null,items=[],name=null;return this.expect(this.tok.T_USE)&&this.next(),type=this.read_use_type(),items.push(this.read_use_declaration(!1)),","===this.token?items=items.concat(this.next().read_use_declarations(!1)):"{"===this.token&&(name=items[0].name,items=this.next().read_use_declarations(null===type),this.expect("}")&&this.next()),
this.expect(";")&&this.nextWithComments(),result(name,type,items)},read_use_declaration:function(typed){var result=this.node("useitem"),type=null;typed&&(type=this.read_use_type());var name=this.read_namespace_name(),alias=this.read_use_alias();return result(name.name,alias,type)},read_use_declarations:function(typed){for(var result=[this.read_use_declaration(typed)];","===this.token;)result.push(this.next().read_use_declaration(typed));return result},read_use_alias:function(){var result=null;return this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)&&(result=this.text(),this.next()),result},read_use_type:function(){return this.token===this.tok.T_FUNCTION?(this.next(),this.ast.useitem.TYPE_FUNCTION):this.token===this.tok.T_CONST?(this.next(),this.ast.useitem.TYPE_CONST):null}}},{}],110:[function(require,module,exports){var specialChar={"\\r":"\r","\\n":"\n","\\t":"\t","\\v":String.fromCharCode(11),"\\e":String.fromCharCode(27),"\\f":String.fromCharCode(12),"\\\\":"\\","\\$":"$",'\\"':'"',"\\'":"'"
};module.exports={resolve_special_chars:function(text){return text.replace(/\\[rntvef"'\\\$]/g,function(seq){return specialChar[seq]})},read_scalar:function(){if(this.is("T_MAGIC_CONST"))return this.get_magic_constant();switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:var value=this.node("string"),text=this.text(),isDoubleQuote='"'===text[0];return text=text.substring(1,text.length-1),this.next(),value=value(isDoubleQuote,this.resolve_special_chars(text)),this.token===this.tok.T_DOUBLE_COLON?this.read_static_getter(value):value;case this.tok.T_START_HEREDOC:if("ST_NOWDOC"===this.lexer.curCondition){var node=this.node("nowdoc"),value=this.next().text(),lastCh=value[value.length-1];return"\n"===lastCh?value="\r"===value[value.length-2]?value.substring(0,value.length-2):value.substring(0,value.length-1):"\r"===lastCh&&(value=value.substring(0,value.length-1)),this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE)&&this.next(),node=node(value,this.lexer.heredoc_label),this.expect(this.tok.T_END_HEREDOC)&&this.next(),
node}return this.next().read_encapsed_string(this.tok.T_END_HEREDOC);case'"':return this.next().read_encapsed_string('"');case'b"':case'B"':var node=this.node("cast"),what=this.next().read_encapsed_string('"');return node("binary",what);case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:var result=this.node("number"),value=this.text();return this.next(),result=result(value);case this.tok.T_ARRAY:case"[":return this.read_array();default:var err=this.error("SCALAR");return this.next(),err}},read_dereferencable:function(expr){var result,node=this.node("offsetlookup");if("["===this.token){var offset=this.next().read_expr();this.expect("]")&&this.next(),result=node(expr,offset)}else if(this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES){var offset=this.read_encapsed_string_item();result=node(expr,offset)}return result},read_encapsed_string_item:function(){var result=this.node();if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){var text=this.text();this.next(),result=result("string",!1,this.resolve_special_chars(text));
}else if(this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES){var name=null;if(this.next().token===this.tok.T_STRING_VARNAME){var varName=this.text();if(name=this.node("variable"),this.next(),"["===this.token){name=name(varName,!1);var node=this.node("offsetlookup"),offset=this.next().read_expr();this.expect("]")&&this.next(),name=node(name,offset)}else name=varName}else name=this.read_expr();this.expect("}")&&this.next(),result=result("variable",name,!1,!0)}else if(this.token===this.tok.T_CURLY_OPEN)result=this.next().read_variable(!1,!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(result=this.read_simple_variable(!1),"["===this.token){var node=this.node("offsetlookup"),offset=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),result=node(result,offset)}if(this.token===this.tok.T_OBJECT_OPERATOR){var node=this.node("propertylookup"),what=this.node("constref");this.next().expect(this.tok.T_STRING);var name=this.text();this.next(),result=node(result,what(name))}}else{
this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);var value=this.text();this.next(),result=result("string",!1,value)}return result},read_encapsed_string:function(expect){var node=this.node("encapsed"),value=[],type=null;for(type="`"===expect?this.ast.encapsed.TYPE_SHELL:'"'===expect?this.ast.encapsed.TYPE_STRING:this.ast.encapsed.TYPE_HEREDOC;this.token!==expect&&this.token!==this.EOF;)value.push(this.read_encapsed_string_item());return this.expect(expect)&&this.next(),node=node(value,type),expect===this.tok.T_END_HEREDOC&&(node.label=this.lexer.heredoc_label),node},get_magic_constant:function(){var result=this.node("magic"),name=this.text();return this.next(),result(name)}}},{}],111:[function(require,module,exports){module.exports={read_top_statements:function(){for(var result=[];this.token!==this.EOF&&"}"!==this.token;){var statement=this.read_top_statement();statement&&(Array.isArray(statement)?result=result.concat(statement):result.push(statement))}return result},read_top_statement:function(){switch(this.token){
case this.tok.T_FUNCTION:return this.read_function(!1,!1);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:var flag=this.read_class_scope();return this.token===this.tok.T_CLASS?this.read_class(flag):(this.error(this.tok.T_CLASS),this.next(),null);case this.tok.T_CLASS:return this.read_class([0,0,0]);case this.tok.T_INTERFACE:return this.read_interface();case this.tok.T_TRAIT:return this.read_trait();case this.tok.T_USE:return this.read_use_statement();case this.tok.T_CONST:return this.next().read_const_list();case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:var result=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,result(this.lexer._input.substring(this.lexer.offset));default:return this.read_statement()}},read_inner_statements:function(){for(var result=[];this.token!=this.EOF&&"}"!==this.token;){var statement=this.read_inner_statement();statement&&(Array.isArray(statement)?result=result.concat(statement):result.push(statement));
}return result},read_const_list:function(){var result=this.read_list(function(){this.expect(this.tok.T_STRING);var result=this.node("constant"),name=this.text();return this.next().expect("=")?result(name,this.next().read_expr()):result(name,null)},",",!1);return this.expectEndOfStatement(),result},read_declare_list:function(){for(var result={};this.token!=this.EOF&&")"!==this.token;){this.expect(this.tok.T_STRING);var name=this.text().toLowerCase();if(this.next().expect("=")?result[name]=this.next().read_expr():result[name]=null,","!==this.token)break;this.next()}return result},read_inner_statement:function(){switch(this.token){case this.tok.T_FUNCTION:return this.read_function(!1,!1);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:var flag=this.read_class_scope();return this.token===this.tok.T_CLASS?this.read_class(flag):(this.error(this.tok.T_CLASS),this.next(),null);case this.tok.T_CLASS:return this.read_class([0,0,0]);case this.tok.T_INTERFACE:return this.read_interface();case this.tok.T_TRAIT:return this.read_trait();
case this.tok.T_HALT_COMPILER:this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");var node=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),node=node(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),node;default:return this.read_statement()}},read_statement:function(){switch(this.token){case"{":return this.read_code_block(!1);case this.tok.T_IF:return this.next().read_if();case this.tok.T_SWITCH:return this.read_switch();case this.tok.T_FOR:return this.next().read_for();case this.tok.T_FOREACH:return this.next().read_foreach();case this.tok.T_WHILE:return this.next().read_while();case this.tok.T_DO:return this.next().read_do();case this.tok.T_COMMENT:return this.read_comment();case this.tok.T_DOC_COMMENT:return this.read_doc_comment();case this.tok.T_RETURN:var result=this.node("return"),expr=null;return this.next().is("EOS")||(expr=this.read_expr()),this.expectEndOfStatement(),result(expr);case this.tok.T_BREAK:
case this.tok.T_CONTINUE:var result=this.node(this.token===this.tok.T_CONTINUE?"continue":"break"),level=null;return this.next(),";"!==this.token&&this.token!==this.tok.T_CLOSE_TAG&&(level=this.read_expr()),this.expectEndOfStatement(),result(level);case this.tok.T_GLOBAL:var result=this.node("global"),items=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),result(items);case this.tok.T_STATIC:var current=[this.token,this.lexer.getState()],result=this.node("static");if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(current);var expr=this.next().read_expr();return this.expect(";")&&this.nextWithComments(),expr}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);var items=this.read_variable_declarations();return this.expectEndOfStatement(),result(items);case this.tok.T_ECHO:var result=this.node("echo"),args=this.next().read_list(this.read_expr,",");return this.expectEndOfStatement(),result(args);case this.tok.T_INLINE_HTML:var result=this.node("inline"),value=this.text();
return this.next(),result(value);case this.tok.T_UNSET:var result=this.node("unset");this.next().expect("(")&&this.next();var items=this.read_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.nextWithComments(),result(items);case this.tok.T_DECLARE:var what,mode,result=this.node("declare"),body=[];if(this.next().expect("(")&&this.next(),what=this.read_declare_list(),this.expect(")")&&this.next(),":"===this.token){for(this.nextWithComments();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)body.push(this.read_top_statement());this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),mode=this.ast.declare.MODE_SHORT}else if("{"===this.token){for(this.nextWithComments();this.token!=this.EOF&&"}"!==this.token;)body.push(this.read_top_statement());this.expect("}")&&this.next(),mode=this.ast.declare.MODE_BLOCK}else{for(this.expect(";")&&this.nextWithComments();this.token!=this.EOF&&this.token!==this.tok.T_DECLARE;)body.push(this.read_top_statement());mode=this.ast.declare.MODE_NONE;
}return result(what,body,mode);case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:var result=this.node("throw"),expr=this.next().read_expr();return this.expectEndOfStatement(),result(expr);case";":case this.tok.T_CLOSE_TAG:return this.next(),null;case this.tok.T_STRING:var current=[this.token,this.lexer.getState()],label=this.text();if(":"===this.next().token){var result=this.node("label");return this.next(),result(label)}this.lexer.tokens.push(current);var expr=this.next().read_expr();return this.expectEndOfStatement(),expr;case this.tok.T_GOTO:var result=this.node("goto"),label=null;return this.next().expect(this.tok.T_STRING)&&(label=this.text(),this.next().expectEndOfStatement()),result(label);default:var expr=this.read_expr();return this.expectEndOfStatement(),expr}},read_code_block:function(top){var result=this.node("block");this.expect("{")&&this.nextWithComments();var body=top?this.read_top_statements():this.read_inner_statements();return this.expect("}")&&this.nextWithComments(),result(null,body);
}}},{}],112:[function(require,module,exports){"use strict";module.exports={read_switch:function(){this.expect(this.tok.T_SWITCH)&&this.next();var test,body,shortForm,result=this.node("switch");return this.expect("(")&&this.next(),test=this.read_expr(),this.expect(")")&&this.next(),shortForm=":"===this.token,body=this.read_switch_case_list(),result(test,body,shortForm)},read_switch_case_list:function(){var expect=null,result=this.node("block"),items=[];for("{"===this.token?expect="}":":"===this.token?expect=this.tok.T_ENDSWITCH:this.expect(["{",":"]),";"===this.next().token&&this.next(),this.token===this.tok.T_CLOSE_TAG&&this.next();this.token!==this.EOF&&this.token!==expect;)items.push(this.read_case_list(expect));return this.expect(expect)&&this.next(),expect===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),result(null,items)},read_case_list:function(stopToken){var result=this.node("case"),test=null,body=null,items=[];for(this.token===this.tok.T_CASE?test=this.next().read_expr():this.token===this.tok.T_DEFAULT?this.next():this.expect([this.tok.T_CASE,this.tok.T_DEFAULT]),
this.expect([":",";"])&&this.next(),body=this.node("block");this.token!=this.EOF&&this.token!==stopToken&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)items.push(this.read_inner_statement());return result(test,items.length>0?body(null,items):null)}}},{}],113:[function(require,module,exports){module.exports={read_try:function(){this.expect(this.tok.T_TRY);var body,result=this.node("try"),always=null,catches=[];for(body=this.next().read_statement();this.ignoreComments().token===this.tok.T_CATCH;){var item=this.node("catch"),what=[],variable=null;this.next().expect("(")&&this.next(),what=this.read_list(this.read_namespace_name,"|",!1),variable=this.read_variable(!0,!1,!1),this.expect(")"),catches.push(item(this.next().read_statement(),what,variable))}return this.token===this.tok.T_FINALLY&&(always=this.next().read_statement()),result(body,catches,always)}}},{}],114:[function(require,module,exports){"use strict";module.exports={read_short_form:function(token){var body=this.node("block"),items=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==token;)items.push(this.read_inner_statement());
return this.expect(token)&&this.next(),this.expectEndOfStatement(),body(null,items)},read_list:function(item,separator,preserveFirstSeparator){var result=[];if(this.token==separator&&(preserveFirstSeparator&&result.push(""),this.next()),"function"==typeof item){do if(result.push(item.apply(this,[])),this.token!=separator)break;while(this.next().token!=this.EOF)}else{if(!this.expect(item))return[];for(result.push(this.text());this.next().token!=this.EOF&&this.token==separator&&this.next().token==item;)result.push(this.text())}return result},read_name_list:function(){return this.read_list(this.read_namespace_name,",",!1)},read_variable_declarations:function(){return this.read_list(function(){var node=this.node("assign"),variable=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){var name=this.text().substring(1);this.next(),variable=variable(name,!1,!1)}else variable=variable("#ERR",!1,!1);return"="===this.token?node(variable,this.next().read_expr()):variable},",")}}},{}],115:[function(require,module,exports){
"use strict";module.exports={read_variable:function(read_only,encapsed,byref){var result;if(byref||"&"!==this.token||(byref=!0,this.next()),this.is([this.tok.T_VARIABLE,"$"]))result=this.read_reference_variable(encapsed,byref);else if(this.is([this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAMESPACE])){result=this.node();var name=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&"("!=this.token){var literal=name.name.toLowerCase();result="true"===literal?result("boolean",!0):"false"===literal?result("boolean",!1):result("constref",name)}else result=name}else this.token===this.tok.T_STATIC?(result=this.node("constref"),this.next(),result=result("static")):this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(result=this.read_static_getter(result,encapsed)),this.recursive_variable_chain_scan(result,read_only,encapsed)},read_static_getter:function(what,encapsed){var result=this.node("staticlookup"),offset=null;if(this.next().is([this.tok.T_VARIABLE,"$"]))offset=this.read_reference_variable(encapsed,!1);else if(this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS){
offset=this.node("constref");var name=this.text();this.next(),offset=offset(name)}else{this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),offset=this.node("constref");var name=this.text();this.next(),offset=offset(name)}return result(what,offset)},recursive_variable_chain_scan:function(result,read_only,encapsed){recursive_scan_loop:for(;this.token!=this.EOF;)switch(this.token){case"(":if(read_only)return result;result=this.node("call")(result,this.read_function_argument_list());break;case"[":var node=this.node("offsetlookup");this.next();var offset=!1;encapsed?(offset=this.read_encaps_var_offset(),this.expect("]")&&this.next()):"]"!==this.token?(offset=this.read_expr(),this.expect("]")&&this.next()):this.next(),result=node(result,offset);break;case this.tok.T_OBJECT_OPERATOR:var node=this.node("propertylookup"),what=null;switch(this.next().token){case this.tok.T_STRING:what=this.node("constref");var name=this.text();if(this.next(),what=what(name),this.token===this.tok.T_VARIABLE){var inner=this.node("variable");
name=this.text().substring(1),this.next(),what=this.node("encapsed")([what,inner(name,!1,!1)],"offset"),what.loc&&what.value[0].loc&&(what.loc.start=what.value[0].loc.start)}else if("{"===this.token){var expr=this.next().read_expr();this.expect("}")&&this.next(),what=this.node("encapsed")([what,expr],"offset"),what.loc&&what.value[0].loc&&(what.loc.start=what.value[0].loc.start)}break;case this.tok.T_VARIABLE:what=this.node("variable");var name=this.text().substring(1);this.next(),what=what(name,!1,!1);break;case"$":this.next().expect(["{",this.tok.T_VARIABLE]),"{"===this.token?(what=this.next().read_expr(),this.expect("}")&&this.next()):what=this.read_expr();break;case"{":what=this.next().read_expr(),this.expect("}")&&this.next();break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE]),what=this.node("constref");var name=this.text();this.next(),what=what(name)}result=node(result,what);break;default:break recursive_scan_loop}return result},read_encaps_var_offset:function(){var offset=this.node();if(this.token===this.tok.T_STRING){
var text=this.text(),isDblQuote='"'===text[0];text=text.substring(1,text.length-1),this.next(),offset=offset("string",isDblQuote,this.resolve_special_chars(text))}else if(this.token===this.tok.T_NUM_STRING){var num=this.text();this.next(),offset=offset("number",num)}else if(this.token===this.tok.T_VARIABLE){var name=this.text().substring(1);this.next(),offset=offset("variable",name,!1,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,this.tok.T_VARIABLE]);var text=this.text();this.next(),offset=offset("string",!1,text)}return offset},read_reference_variable:function(encapsed,byref){for(var result=this.read_simple_variable(byref);this.token!=this.EOF;){var node=this.node();if("["==this.token){var offset=null;offset=encapsed?this.next().read_encaps_var_offset():"]"===this.next().token?null:this.read_dim_offset(),this.expect("]")&&this.next(),result=node("offsetlookup",result,offset)}else{if("{"!=this.token||encapsed)break;var offset=this.next().read_expr();this.expect("}")&&this.next(),result=node("offsetlookup",result,offset);
}}return result},read_simple_variable:function(byref){var result=this.node("variable");if(this.expect([this.tok.T_VARIABLE,"$"])&&this.token===this.tok.T_VARIABLE){var name=this.text().substring(1);this.next(),result=result(name,byref,!1)}else switch("$"===this.token&&this.next(),this.token){case"{":var expr=this.next().read_expr();this.expect("}")&&this.next(),result=result(expr,byref,!0);break;case"$":result=result(this.read_simple_variable(!1),byref);break;case this.tok.T_VARIABLE:var name=this.text().substring(1),node=this.node("variable");this.next(),result=result(node(name,!1,!1),byref,!1);break;default:this.error(["{","$",this.tok.T_VARIABLE]);var name=this.text();this.next(),result=result(name,byref,!1)}return result}}},{}],116:[function(require,module,exports){module.exports={values:{101:"T_HALT_COMPILER",102:"T_USE",103:"T_ENCAPSED_AND_WHITESPACE",104:"T_OBJECT_OPERATOR",105:"T_STRING",106:"T_DOLLAR_OPEN_CURLY_BRACES",107:"T_STRING_VARNAME",108:"T_CURLY_OPEN",109:"T_NUM_STRING",110:"T_ISSET",111:"T_EMPTY",
112:"T_INCLUDE",113:"T_INCLUDE_ONCE",114:"T_EVAL",115:"T_REQUIRE",116:"T_REQUIRE_ONCE",117:"T_NAMESPACE",118:"T_NS_SEPARATOR",119:"T_AS",120:"T_IF",121:"T_ENDIF",122:"T_WHILE",123:"T_DO",124:"T_FOR",125:"T_SWITCH",126:"T_BREAK",127:"T_CONTINUE",128:"T_RETURN",129:"T_GLOBAL",130:"T_STATIC",131:"T_ECHO",132:"T_INLINE_HTML",133:"T_UNSET",134:"T_FOREACH",135:"T_DECLARE",136:"T_TRY",137:"T_THROW",138:"T_GOTO",139:"T_FINALLY",140:"T_CATCH",141:"T_ENDDECLARE",142:"T_LIST",143:"T_CLONE",144:"T_PLUS_EQUAL",145:"T_MINUS_EQUAL",146:"T_MUL_EQUAL",147:"T_DIV_EQUAL",148:"T_CONCAT_EQUAL",149:"T_MOD_EQUAL",150:"T_AND_EQUAL",151:"T_OR_EQUAL",152:"T_XOR_EQUAL",153:"T_SL_EQUAL",154:"T_SR_EQUAL",155:"T_INC",156:"T_DEC",157:"T_BOOLEAN_OR",158:"T_BOOLEAN_AND",159:"T_LOGICAL_OR",160:"T_LOGICAL_AND",161:"T_LOGICAL_XOR",162:"T_SL",163:"T_SR",164:"T_IS_IDENTICAL",165:"T_IS_NOT_IDENTICAL",166:"T_IS_EQUAL",167:"T_IS_NOT_EQUAL",168:"T_IS_SMALLER_OR_EQUAL",169:"T_IS_GREATER_OR_EQUAL",170:"T_INSTANCEOF",171:"T_INT_CAST",172:"T_DOUBLE_CAST",
173:"T_STRING_CAST",174:"T_ARRAY_CAST",175:"T_OBJECT_CAST",176:"T_BOOL_CAST",177:"T_UNSET_CAST",178:"T_EXIT",179:"T_PRINT",180:"T_YIELD",181:"T_YIELD_FROM",182:"T_FUNCTION",183:"T_DOUBLE_ARROW",184:"T_DOUBLE_COLON",185:"T_ARRAY",186:"T_CALLABLE",187:"T_CLASS",188:"T_ABSTRACT",189:"T_TRAIT",190:"T_FINAL",191:"T_EXTENDS",192:"T_INTERFACE",193:"T_IMPLEMENTS",194:"T_VAR",195:"T_PUBLIC",196:"T_PROTECTED",197:"T_PRIVATE",198:"T_CONST",199:"T_NEW",200:"T_INSTEADOF",201:"T_ELSEIF",202:"T_ELSE",203:"T_ENDSWITCH",204:"T_CASE",205:"T_DEFAULT",206:"T_ENDFOR",207:"T_ENDFOREACH",208:"T_ENDWHILE",209:"T_CONSTANT_ENCAPSED_STRING",210:"T_LNUMBER",211:"T_DNUMBER",212:"T_LINE",213:"T_FILE",214:"T_DIR",215:"T_TRAIT_C",216:"T_METHOD_C",217:"T_FUNC_C",218:"T_NS_C",219:"T_START_HEREDOC",220:"T_END_HEREDOC",221:"T_CLASS_C",222:"T_VARIABLE",223:"T_OPEN_TAG",224:"T_OPEN_TAG_WITH_ECHO",225:"T_CLOSE_TAG",226:"T_WHITESPACE",227:"T_COMMENT",228:"T_DOC_COMMENT",229:"T_ELLIPSIS",230:"T_COALESCE",231:"T_POW",232:"T_POW_EQUAL",233:"T_SPACESHIP"
},names:{T_HALT_COMPILER:101,T_USE:102,T_ENCAPSED_AND_WHITESPACE:103,T_OBJECT_OPERATOR:104,T_STRING:105,T_DOLLAR_OPEN_CURLY_BRACES:106,T_STRING_VARNAME:107,T_CURLY_OPEN:108,T_NUM_STRING:109,T_ISSET:110,T_EMPTY:111,T_INCLUDE:112,T_INCLUDE_ONCE:113,T_EVAL:114,T_REQUIRE:115,T_REQUIRE_ONCE:116,T_NAMESPACE:117,T_NS_SEPARATOR:118,T_AS:119,T_IF:120,T_ENDIF:121,T_WHILE:122,T_DO:123,T_FOR:124,T_SWITCH:125,T_BREAK:126,T_CONTINUE:127,T_RETURN:128,T_GLOBAL:129,T_STATIC:130,T_ECHO:131,T_INLINE_HTML:132,T_UNSET:133,T_FOREACH:134,T_DECLARE:135,T_TRY:136,T_THROW:137,T_GOTO:138,T_FINALLY:139,T_CATCH:140,T_ENDDECLARE:141,T_LIST:142,T_CLONE:143,T_PLUS_EQUAL:144,T_MINUS_EQUAL:145,T_MUL_EQUAL:146,T_DIV_EQUAL:147,T_CONCAT_EQUAL:148,T_MOD_EQUAL:149,T_AND_EQUAL:150,T_OR_EQUAL:151,T_XOR_EQUAL:152,T_SL_EQUAL:153,T_SR_EQUAL:154,T_INC:155,T_DEC:156,T_BOOLEAN_OR:157,T_BOOLEAN_AND:158,T_LOGICAL_OR:159,T_LOGICAL_AND:160,T_LOGICAL_XOR:161,T_SL:162,T_SR:163,T_IS_IDENTICAL:164,T_IS_NOT_IDENTICAL:165,T_IS_EQUAL:166,T_IS_NOT_EQUAL:167,T_IS_SMALLER_OR_EQUAL:168,
T_IS_GREATER_OR_EQUAL:169,T_INSTANCEOF:170,T_INT_CAST:171,T_DOUBLE_CAST:172,T_STRING_CAST:173,T_ARRAY_CAST:174,T_OBJECT_CAST:175,T_BOOL_CAST:176,T_UNSET_CAST:177,T_EXIT:178,T_PRINT:179,T_YIELD:180,T_YIELD_FROM:181,T_FUNCTION:182,T_DOUBLE_ARROW:183,T_DOUBLE_COLON:184,T_ARRAY:185,T_CALLABLE:186,T_CLASS:187,T_ABSTRACT:188,T_TRAIT:189,T_FINAL:190,T_EXTENDS:191,T_INTERFACE:192,T_IMPLEMENTS:193,T_VAR:194,T_PUBLIC:195,T_PROTECTED:196,T_PRIVATE:197,T_CONST:198,T_NEW:199,T_INSTEADOF:200,T_ELSEIF:201,T_ELSE:202,T_ENDSWITCH:203,T_CASE:204,T_DEFAULT:205,T_ENDFOR:206,T_ENDFOREACH:207,T_ENDWHILE:208,T_CONSTANT_ENCAPSED_STRING:209,T_LNUMBER:210,T_DNUMBER:211,T_LINE:212,T_FILE:213,T_DIR:214,T_TRAIT_C:215,T_METHOD_C:216,T_FUNC_C:217,T_NS_C:218,T_START_HEREDOC:219,T_END_HEREDOC:220,T_CLASS_C:221,T_VARIABLE:222,T_OPEN_TAG:223,T_OPEN_TAG_WITH_ECHO:224,T_CLOSE_TAG:225,T_WHITESPACE:226,T_COMMENT:227,T_DOC_COMMENT:228,T_ELLIPSIS:229,T_COALESCE:230,T_POW:231,T_POW_EQUAL:232,T_SPACESHIP:233}}},{}],"php-parser":[function(require,module,exports){
function combine(src,to){for(var keys=Object.keys(src),i=keys.length;i--;){var k=keys[i],val=src[k];null===val?delete to[k]:"function"==typeof val?to[k]=val.bind(to):Array.isArray(val)?to[k]=Array.isArray(to[k])?to[k].concat(val):val:"object"==typeof val?to[k]="object"==typeof to[k]?combine(val,to[k]):val:to[k]=val}return to}var lexer=require("./lexer"),parser=require("./parser"),tokens=require("./tokens"),AST=require("./ast"),engine=function(options){return"function"==typeof this?new this(options):(this.tokens=tokens,this.lexer=new lexer(this),this.ast=new AST,this.parser=new parser(this.lexer,this.ast),void(options&&"object"==typeof options&&combine(options,this)))};engine.create=function(options){return new engine(options)},engine.parseEval=function(buffer,options){var self=new engine(options);return self.parseEval(buffer)},engine.prototype.parseEval=function(buffer){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,this.parser.parse(buffer,"eval")},engine.parseCode=function(buffer,filename,options){"object"==typeof filename&&(options=filename,
filename="unknown");var self=new engine(options);return self.parseCode(buffer,filename)},engine.prototype.parseCode=function(buffer,filename){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,this.parser.parse(buffer,filename)},engine.tokenGetAll=function(buffer,options){var self=new engine(options);return self.tokenGetAll(buffer)},engine.prototype.tokenGetAll=function(buffer){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0;var EOF=this.lexer.EOF,names=this.tokens.values;this.lexer.setInput(buffer);for(var token=this.lexer.lex()||EOF,result=[];token!=EOF;){var entry=this.lexer.yytext;names.hasOwnProperty(token)&&(entry=[names[token],entry,this.lexer.yylloc.first_line]),result.push(entry),token=this.lexer.lex()||EOF}return result},module.exports=engine},{"./ast":2,"./lexer":91,"./parser":100,"./tokens":116}]},{},[]);
//# sourceMappingURL=php-parser.min.js.map