@appthreat/atom-parsetools 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +78 -0
- package/astgen.js +421 -0
- package/index.js +1 -0
- package/package.json +53 -0
- package/phpastgen.js +33 -0
- package/plugins/.gitkeep +0 -0
- package/plugins/autoload.php +22 -0
- package/plugins/bin/bundler +14 -0
- package/plugins/bin/php-parse +119 -0
- package/plugins/bin/ruby_ast_gen +14 -0
- package/plugins/composer/ClassLoader.php +579 -0
- package/plugins/composer/InstalledVersions.php +396 -0
- package/plugins/composer/LICENSE +21 -0
- package/plugins/composer/autoload_classmap.php +260 -0
- package/plugins/composer/autoload_namespaces.php +9 -0
- package/plugins/composer/autoload_psr4.php +10 -0
- package/plugins/composer/autoload_real.php +36 -0
- package/plugins/composer/autoload_static.php +286 -0
- package/plugins/composer/installed.json +65 -0
- package/plugins/composer/installed.php +32 -0
- package/plugins/log4j2.xml +13 -0
- package/plugins/nikic/php-parser/LICENSE +29 -0
- package/plugins/nikic/php-parser/README.md +225 -0
- package/plugins/nikic/php-parser/bin/php-parse +205 -0
- package/plugins/nikic/php-parser/composer.json +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +148 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Class_.php +146 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +85 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +117 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +73 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Function_.php +67 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +93 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Method.php +146 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +45 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Param.php +168 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Property.php +161 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +64 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +148 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +78 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Use_.php +49 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder.php +13 -0
- package/plugins/nikic/php-parser/lib/PhpParser/BuilderFactory.php +399 -0
- package/plugins/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +335 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Comment/Doc.php +7 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Comment.php +239 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +6 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +229 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Error.php +180 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +46 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +18 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler.php +13 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +27 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/Differ.php +164 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +64 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +286 -0
- package/plugins/nikic/php-parser/lib/PhpParser/JsonDecoder.php +103 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +251 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +56 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +47 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +44 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +76 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +23 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +62 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +23 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +67 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +105 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +25 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer.php +560 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NameContext.php +285 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Arg.php +46 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Attribute.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +29 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +14 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Const_.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +79 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +40 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +17 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +26 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +79 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +35 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +45 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +45 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +35 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +35 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +46 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr.php +9 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Identifier.php +75 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +50 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +50 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name.php +254 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/NullableType.php +28 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Param.php +60 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +77 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +80 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +28 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +157 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar.php +7 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +85 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +109 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +161 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +137 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +40 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +33 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +47 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +77 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +17 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +91 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +13 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +32 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +52 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +47 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt.php +9 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/UnionType.php +28 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +17 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +27 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node.php +151 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeAbstract.php +178 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeDumper.php +206 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeFinder.php +81 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverser.php +291 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +29 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +20 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +48 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +50 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +260 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +52 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor.php +72 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +25 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +55 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php5.php +2682 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php7.php +2898 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +148 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser.php +18 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ParserAbstract.php +1060 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ParserFactory.php +76 -0
- package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +1126 -0
- package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +1576 -0
- package/plugins/rubyastgen/.bundle/config +5 -0
- package/plugins/rubyastgen/Gemfile +12 -0
- package/plugins/rubyastgen/Gemfile.lock +34 -0
- package/plugins/rubyastgen/bundle/bundler/setup.rb +42 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/racc +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby-parse +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby-rewrite +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby_ast_gen +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/.rspec +3 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/Gemfile +10 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/LICENSE.txt +213 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/README.md +46 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/Rakefile +8 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/bin/console +11 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/bin/setup +6 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/exe/ruby_ast_gen +59 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen/node_handling.rb +232 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen/version.rb +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen.rb +140 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/ruby_ast_gen.gemspec +25 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/spec/ruby_ast_gen_spec.rb +175 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/spec/spec_helper.rb +15 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/update_version.rb +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/gem.build_complete +0 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/gem_make.out +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/racc/cparse.so +0 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/LICENSE.MIT +20 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/README.YARD.md +12 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/node.rb +268 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/processor/mixin.rb +288 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/processor.rb +12 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/sexp.rb +30 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast.rb +17 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/BSDL +22 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/COPYING +56 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/Gemfile +10 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/README.md +69 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/Rakefile +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/bin/console +14 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/bin/setup +8 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/lib/ostruct.rb +489 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/ostruct.gemspec +24 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/LICENSE.txt +26 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/bin/ruby-parse +7 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/bin/ruby-rewrite +7 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/gauntlet_parser.rb +123 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/all.rb +17 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ast/node.rb +40 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ast/processor.rb +293 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/base.rb +294 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/builders/default.rb +2351 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/clobbering_error.rb +13 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/color.rb +32 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/context.rb +51 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/current.rb +146 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/current_arg_stack.rb +46 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/deprecation.rb +13 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/diagnostic/engine.rb +104 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/diagnostic.rb +163 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/dedenter.rb +88 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/explanation.rb +55 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/literal.rb +284 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/stack_state.rb +49 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-F0.rb +12931 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-F1.rb +14884 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-strings.rb +5433 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/macruby.rb +9634 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/max_numparam_stack.rb +56 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/messages.rb +125 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/meta.rb +48 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/rewriter.rb +105 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby18.rb +9272 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby19.rb +9558 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby20.rb +10229 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby21.rb +10203 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby22.rb +10302 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby23.rb +10322 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby24.rb +10454 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby25.rb +10374 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby26.rb +10352 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby27.rb +11948 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby30.rb +12244 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby31.rb +12717 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby32.rb +12705 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby33.rb +12590 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby34.rb +12597 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/rubymotion.rb +9515 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner/ruby_parse.rb +157 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner/ruby_rewrite.rb +101 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner.rb +299 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/buffer.rb +369 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/comment/associator.rb +233 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/comment.rb +134 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/collection.rb +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/condition.rb +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/constant.rb +32 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/definition.rb +23 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/for.rb +19 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/heredoc.rb +19 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/index.rb +33 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/keyword.rb +20 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/method_definition.rb +25 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/objc_kwarg.rb +19 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/operator.rb +17 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/rescue_body.rb +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/send.rb +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/ternary.rb +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/variable.rb +31 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map.rb +186 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/range.rb +326 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/rewriter/action.rb +44 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/rewriter.rb +513 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/tree_rewriter/action.rb +243 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/tree_rewriter.rb +431 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/static_environment.rb +134 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/syntax_error.rb +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/tree_rewriter.rb +133 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/unknown_encoding_in_magic_comment_error.rb +15 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/variables_stack.rb +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/version.rb +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser.rb +91 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/parser.gemspec +43 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/BSDL +22 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/COPYING +56 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ChangeLog +846 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/README.rdoc +60 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/TODO +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/bin/racc +320 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/en/grammar.en.rdoc +218 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/en/grammar2.en.rdoc +219 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/command.ja.html +99 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/debug.ja.rdoc +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/grammar.ja.rdoc +348 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/index.ja.html +10 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/parser.ja.rdoc +125 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/usage.ja.html +414 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/Makefile +273 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/cparse.c +840 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/extconf.rb +8 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/compat.rb +33 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/debugflags.rb +60 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/exception.rb +16 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/grammar.rb +1191 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/grammarfileparser.rb +667 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/info.rb +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/iset.rb +92 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/logfilegenerator.rb +212 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parser-text.rb +644 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parser.rb +630 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parserfilegenerator.rb +473 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/sourcetext.rb +35 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/state.rb +976 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/statetransitiontable.rb +311 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/static.rb +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc.rb +6 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/ast-2.4.3.gemspec +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/ostruct-0.6.1.gemspec +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/parser-3.3.8.0.gemspec +37 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +28 -0
- package/plugins/rubyastgen/setup.ps1 +4 -0
- package/plugins/rubyastgen/setup.sh +6 -0
- package/rbastgen.js +53 -0
- package/scalasem.js +365 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
PHP Parser
|
|
2
|
+
==========
|
|
3
|
+
|
|
4
|
+
[](https://coveralls.io/github/nikic/PHP-Parser?branch=master)
|
|
5
|
+
|
|
6
|
+
This is a PHP 5.2 to PHP 8.2 parser written in PHP. Its purpose is to simplify static code analysis and
|
|
7
|
+
manipulation.
|
|
8
|
+
|
|
9
|
+
[**Documentation for version 4.x**][doc_4_x] (stable; for running on PHP >= 7.0; for parsing PHP 5.2 to PHP 8.2).
|
|
10
|
+
|
|
11
|
+
[Documentation for version 3.x][doc_3_x] (unsupported; for running on PHP >= 5.5; for parsing PHP 5.2 to PHP 7.2).
|
|
12
|
+
|
|
13
|
+
Features
|
|
14
|
+
--------
|
|
15
|
+
|
|
16
|
+
The main features provided by this library are:
|
|
17
|
+
|
|
18
|
+
* Parsing PHP 5, PHP 7, and PHP 8 code into an abstract syntax tree (AST).
|
|
19
|
+
* Invalid code can be parsed into a partial AST.
|
|
20
|
+
* The AST contains accurate location information.
|
|
21
|
+
* Dumping the AST in human-readable form.
|
|
22
|
+
* Converting an AST back to PHP code.
|
|
23
|
+
* Experimental: Formatting can be preserved for partially changed ASTs.
|
|
24
|
+
* Infrastructure to traverse and modify ASTs.
|
|
25
|
+
* Resolution of namespaced names.
|
|
26
|
+
* Evaluation of constant expressions.
|
|
27
|
+
* Builders to simplify AST construction for code generation.
|
|
28
|
+
* Converting an AST into JSON and back.
|
|
29
|
+
|
|
30
|
+
Quick Start
|
|
31
|
+
-----------
|
|
32
|
+
|
|
33
|
+
Install the library using [composer](https://getcomposer.org):
|
|
34
|
+
|
|
35
|
+
php composer.phar require nikic/php-parser
|
|
36
|
+
|
|
37
|
+
Parse some PHP code into an AST and dump the result in human-readable form:
|
|
38
|
+
|
|
39
|
+
```php
|
|
40
|
+
<?php
|
|
41
|
+
use PhpParser\Error;
|
|
42
|
+
use PhpParser\NodeDumper;
|
|
43
|
+
use PhpParser\ParserFactory;
|
|
44
|
+
|
|
45
|
+
$code = <<<'CODE'
|
|
46
|
+
<?php
|
|
47
|
+
|
|
48
|
+
function test($foo)
|
|
49
|
+
{
|
|
50
|
+
var_dump($foo);
|
|
51
|
+
}
|
|
52
|
+
CODE;
|
|
53
|
+
|
|
54
|
+
$parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7);
|
|
55
|
+
try {
|
|
56
|
+
$ast = $parser->parse($code);
|
|
57
|
+
} catch (Error $error) {
|
|
58
|
+
echo "Parse error: {$error->getMessage()}\n";
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
$dumper = new NodeDumper;
|
|
63
|
+
echo $dumper->dump($ast) . "\n";
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This dumps an AST looking something like this:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
array(
|
|
70
|
+
0: Stmt_Function(
|
|
71
|
+
byRef: false
|
|
72
|
+
name: Identifier(
|
|
73
|
+
name: test
|
|
74
|
+
)
|
|
75
|
+
params: array(
|
|
76
|
+
0: Param(
|
|
77
|
+
type: null
|
|
78
|
+
byRef: false
|
|
79
|
+
variadic: false
|
|
80
|
+
var: Expr_Variable(
|
|
81
|
+
name: foo
|
|
82
|
+
)
|
|
83
|
+
default: null
|
|
84
|
+
)
|
|
85
|
+
)
|
|
86
|
+
returnType: null
|
|
87
|
+
stmts: array(
|
|
88
|
+
0: Stmt_Expression(
|
|
89
|
+
expr: Expr_FuncCall(
|
|
90
|
+
name: Name(
|
|
91
|
+
parts: array(
|
|
92
|
+
0: var_dump
|
|
93
|
+
)
|
|
94
|
+
)
|
|
95
|
+
args: array(
|
|
96
|
+
0: Arg(
|
|
97
|
+
value: Expr_Variable(
|
|
98
|
+
name: foo
|
|
99
|
+
)
|
|
100
|
+
byRef: false
|
|
101
|
+
unpack: false
|
|
102
|
+
)
|
|
103
|
+
)
|
|
104
|
+
)
|
|
105
|
+
)
|
|
106
|
+
)
|
|
107
|
+
)
|
|
108
|
+
)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Let's traverse the AST and perform some kind of modification. For example, drop all function bodies:
|
|
112
|
+
|
|
113
|
+
```php
|
|
114
|
+
use PhpParser\Node;
|
|
115
|
+
use PhpParser\Node\Stmt\Function_;
|
|
116
|
+
use PhpParser\NodeTraverser;
|
|
117
|
+
use PhpParser\NodeVisitorAbstract;
|
|
118
|
+
|
|
119
|
+
$traverser = new NodeTraverser();
|
|
120
|
+
$traverser->addVisitor(new class extends NodeVisitorAbstract {
|
|
121
|
+
public function enterNode(Node $node) {
|
|
122
|
+
if ($node instanceof Function_) {
|
|
123
|
+
// Clean out the function body
|
|
124
|
+
$node->stmts = [];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
$ast = $traverser->traverse($ast);
|
|
130
|
+
echo $dumper->dump($ast) . "\n";
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
This gives us an AST where the `Function_::$stmts` are empty:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
array(
|
|
137
|
+
0: Stmt_Function(
|
|
138
|
+
byRef: false
|
|
139
|
+
name: Identifier(
|
|
140
|
+
name: test
|
|
141
|
+
)
|
|
142
|
+
params: array(
|
|
143
|
+
0: Param(
|
|
144
|
+
type: null
|
|
145
|
+
byRef: false
|
|
146
|
+
variadic: false
|
|
147
|
+
var: Expr_Variable(
|
|
148
|
+
name: foo
|
|
149
|
+
)
|
|
150
|
+
default: null
|
|
151
|
+
)
|
|
152
|
+
)
|
|
153
|
+
returnType: null
|
|
154
|
+
stmts: array(
|
|
155
|
+
)
|
|
156
|
+
)
|
|
157
|
+
)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Finally, we can convert the new AST back to PHP code:
|
|
161
|
+
|
|
162
|
+
```php
|
|
163
|
+
use PhpParser\PrettyPrinter;
|
|
164
|
+
|
|
165
|
+
$prettyPrinter = new PrettyPrinter\Standard;
|
|
166
|
+
echo $prettyPrinter->prettyPrintFile($ast);
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
This gives us our original code, minus the `var_dump()` call inside the function:
|
|
170
|
+
|
|
171
|
+
```php
|
|
172
|
+
<?php
|
|
173
|
+
|
|
174
|
+
function test($foo)
|
|
175
|
+
{
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
For a more comprehensive introduction, see the documentation.
|
|
180
|
+
|
|
181
|
+
Documentation
|
|
182
|
+
-------------
|
|
183
|
+
|
|
184
|
+
1. [Introduction](doc/0_Introduction.markdown)
|
|
185
|
+
2. [Usage of basic components](doc/2_Usage_of_basic_components.markdown)
|
|
186
|
+
|
|
187
|
+
Component documentation:
|
|
188
|
+
|
|
189
|
+
* [Walking the AST](doc/component/Walking_the_AST.markdown)
|
|
190
|
+
* Node visitors
|
|
191
|
+
* Modifying the AST from a visitor
|
|
192
|
+
* Short-circuiting traversals
|
|
193
|
+
* Interleaved visitors
|
|
194
|
+
* Simple node finding API
|
|
195
|
+
* Parent and sibling references
|
|
196
|
+
* [Name resolution](doc/component/Name_resolution.markdown)
|
|
197
|
+
* Name resolver options
|
|
198
|
+
* Name resolution context
|
|
199
|
+
* [Pretty printing](doc/component/Pretty_printing.markdown)
|
|
200
|
+
* Converting AST back to PHP code
|
|
201
|
+
* Customizing formatting
|
|
202
|
+
* Formatting-preserving code transformations
|
|
203
|
+
* [AST builders](doc/component/AST_builders.markdown)
|
|
204
|
+
* Fluent builders for AST nodes
|
|
205
|
+
* [Lexer](doc/component/Lexer.markdown)
|
|
206
|
+
* Lexer options
|
|
207
|
+
* Token and file positions for nodes
|
|
208
|
+
* Custom attributes
|
|
209
|
+
* [Error handling](doc/component/Error_handling.markdown)
|
|
210
|
+
* Column information for errors
|
|
211
|
+
* Error recovery (parsing of syntactically incorrect code)
|
|
212
|
+
* [Constant expression evaluation](doc/component/Constant_expression_evaluation.markdown)
|
|
213
|
+
* Evaluating constant/property/etc initializers
|
|
214
|
+
* Handling errors and unsupported expressions
|
|
215
|
+
* [JSON representation](doc/component/JSON_representation.markdown)
|
|
216
|
+
* JSON encoding and decoding of ASTs
|
|
217
|
+
* [Performance](doc/component/Performance.markdown)
|
|
218
|
+
* Disabling Xdebug
|
|
219
|
+
* Reusing objects
|
|
220
|
+
* Garbage collection impact
|
|
221
|
+
* [Frequently asked questions](doc/component/FAQ.markdown)
|
|
222
|
+
* Parent and sibling references
|
|
223
|
+
|
|
224
|
+
[doc_3_x]: https://github.com/nikic/PHP-Parser/tree/3.x/doc
|
|
225
|
+
[doc_4_x]: https://github.com/nikic/PHP-Parser/tree/4.x/doc
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
#!/usr/bin/env php
|
|
2
|
+
<?php
|
|
3
|
+
|
|
4
|
+
foreach ([__DIR__ . '/../../../autoload.php', __DIR__ . '/../vendor/autoload.php'] as $file) {
|
|
5
|
+
if (file_exists($file)) {
|
|
6
|
+
require $file;
|
|
7
|
+
break;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
ini_set('xdebug.max_nesting_level', 3000);
|
|
12
|
+
|
|
13
|
+
// Disable Xdebug var_dump() output truncation
|
|
14
|
+
ini_set('xdebug.var_display_max_children', -1);
|
|
15
|
+
ini_set('xdebug.var_display_max_data', -1);
|
|
16
|
+
ini_set('xdebug.var_display_max_depth', -1);
|
|
17
|
+
|
|
18
|
+
list($operations, $files, $attributes) = parseArgs($argv);
|
|
19
|
+
|
|
20
|
+
/* Dump nodes by default */
|
|
21
|
+
if (empty($operations)) {
|
|
22
|
+
$operations[] = 'dump';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (empty($files)) {
|
|
26
|
+
showHelp("Must specify at least one file.");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
$lexer = new PhpParser\Lexer\Emulative(['usedAttributes' => [
|
|
30
|
+
'startLine', 'endLine', 'startFilePos', 'endFilePos', 'comments'
|
|
31
|
+
]]);
|
|
32
|
+
$parser = (new PhpParser\ParserFactory)->create(
|
|
33
|
+
PhpParser\ParserFactory::PREFER_PHP7,
|
|
34
|
+
$lexer
|
|
35
|
+
);
|
|
36
|
+
$dumper = new PhpParser\NodeDumper([
|
|
37
|
+
'dumpComments' => true,
|
|
38
|
+
'dumpPositions' => $attributes['with-positions'],
|
|
39
|
+
]);
|
|
40
|
+
$prettyPrinter = new PhpParser\PrettyPrinter\Standard;
|
|
41
|
+
|
|
42
|
+
$traverser = new PhpParser\NodeTraverser();
|
|
43
|
+
$traverser->addVisitor(new PhpParser\NodeVisitor\NameResolver);
|
|
44
|
+
|
|
45
|
+
foreach ($files as $file) {
|
|
46
|
+
if (strpos($file, '<?php') === 0) {
|
|
47
|
+
$code = $file;
|
|
48
|
+
fwrite(STDERR, "====> Code $code\n");
|
|
49
|
+
} else {
|
|
50
|
+
if (!file_exists($file)) {
|
|
51
|
+
fwrite(STDERR, "File $file does not exist.\n");
|
|
52
|
+
exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
$code = file_get_contents($file);
|
|
56
|
+
fwrite(STDERR, "====> File $file:\n");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if ($attributes['with-recovery']) {
|
|
60
|
+
$errorHandler = new PhpParser\ErrorHandler\Collecting;
|
|
61
|
+
$stmts = $parser->parse($code, $errorHandler);
|
|
62
|
+
foreach ($errorHandler->getErrors() as $error) {
|
|
63
|
+
$message = formatErrorMessage($error, $code, $attributes['with-column-info']);
|
|
64
|
+
fwrite(STDERR, $message . "\n");
|
|
65
|
+
}
|
|
66
|
+
if (null === $stmts) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
try {
|
|
71
|
+
$stmts = $parser->parse($code);
|
|
72
|
+
} catch (PhpParser\Error $error) {
|
|
73
|
+
$message = formatErrorMessage($error, $code, $attributes['with-column-info']);
|
|
74
|
+
fwrite(STDERR, $message . "\n");
|
|
75
|
+
exit(1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
foreach ($operations as $operation) {
|
|
80
|
+
if ('dump' === $operation) {
|
|
81
|
+
fwrite(STDERR, "==> Node dump:\n");
|
|
82
|
+
echo $dumper->dump($stmts, $code), "\n";
|
|
83
|
+
} elseif ('pretty-print' === $operation) {
|
|
84
|
+
fwrite(STDERR, "==> Pretty print:\n");
|
|
85
|
+
echo $prettyPrinter->prettyPrintFile($stmts), "\n";
|
|
86
|
+
} elseif ('json-dump' === $operation) {
|
|
87
|
+
fwrite(STDERR, "==> JSON dump:\n");
|
|
88
|
+
echo json_encode($stmts, JSON_PRETTY_PRINT), "\n";
|
|
89
|
+
} elseif ('var-dump' === $operation) {
|
|
90
|
+
fwrite(STDERR, "==> var_dump():\n");
|
|
91
|
+
var_dump($stmts);
|
|
92
|
+
} elseif ('resolve-names' === $operation) {
|
|
93
|
+
fwrite(STDERR, "==> Resolved names.\n");
|
|
94
|
+
$stmts = $traverser->traverse($stmts);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function formatErrorMessage(PhpParser\Error $e, $code, $withColumnInfo) {
|
|
100
|
+
if ($withColumnInfo && $e->hasColumnInfo()) {
|
|
101
|
+
return $e->getMessageWithColumnInfo($code);
|
|
102
|
+
} else {
|
|
103
|
+
return $e->getMessage();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function showHelp($error = '') {
|
|
108
|
+
if ($error) {
|
|
109
|
+
fwrite(STDERR, $error . "\n\n");
|
|
110
|
+
}
|
|
111
|
+
fwrite($error ? STDERR : STDOUT, <<<OUTPUT
|
|
112
|
+
Usage: php-parse [operations] file1.php [file2.php ...]
|
|
113
|
+
or: php-parse [operations] "<?php code"
|
|
114
|
+
Turn PHP source code into an abstract syntax tree.
|
|
115
|
+
|
|
116
|
+
Operations is a list of the following options (--dump by default):
|
|
117
|
+
|
|
118
|
+
-d, --dump Dump nodes using NodeDumper
|
|
119
|
+
-p, --pretty-print Pretty print file using PrettyPrinter\Standard
|
|
120
|
+
-j, --json-dump Print json_encode() result
|
|
121
|
+
--var-dump var_dump() nodes (for exact structure)
|
|
122
|
+
-N, --resolve-names Resolve names using NodeVisitor\NameResolver
|
|
123
|
+
-c, --with-column-info Show column-numbers for errors (if available)
|
|
124
|
+
-P, --with-positions Show positions in node dumps
|
|
125
|
+
-r, --with-recovery Use parsing with error recovery
|
|
126
|
+
-h, --help Display this page
|
|
127
|
+
|
|
128
|
+
Example:
|
|
129
|
+
php-parse -d -p -N -d file.php
|
|
130
|
+
|
|
131
|
+
Dumps nodes, pretty prints them, then resolves names and dumps them again.
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
OUTPUT
|
|
135
|
+
);
|
|
136
|
+
exit($error ? 1 : 0);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function parseArgs($args) {
|
|
140
|
+
$operations = [];
|
|
141
|
+
$files = [];
|
|
142
|
+
$attributes = [
|
|
143
|
+
'with-column-info' => false,
|
|
144
|
+
'with-positions' => false,
|
|
145
|
+
'with-recovery' => false,
|
|
146
|
+
];
|
|
147
|
+
|
|
148
|
+
array_shift($args);
|
|
149
|
+
$parseOptions = true;
|
|
150
|
+
foreach ($args as $arg) {
|
|
151
|
+
if (!$parseOptions) {
|
|
152
|
+
$files[] = $arg;
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
switch ($arg) {
|
|
157
|
+
case '--dump':
|
|
158
|
+
case '-d':
|
|
159
|
+
$operations[] = 'dump';
|
|
160
|
+
break;
|
|
161
|
+
case '--pretty-print':
|
|
162
|
+
case '-p':
|
|
163
|
+
$operations[] = 'pretty-print';
|
|
164
|
+
break;
|
|
165
|
+
case '--json-dump':
|
|
166
|
+
case '-j':
|
|
167
|
+
$operations[] = 'json-dump';
|
|
168
|
+
break;
|
|
169
|
+
case '--var-dump':
|
|
170
|
+
$operations[] = 'var-dump';
|
|
171
|
+
break;
|
|
172
|
+
case '--resolve-names':
|
|
173
|
+
case '-N';
|
|
174
|
+
$operations[] = 'resolve-names';
|
|
175
|
+
break;
|
|
176
|
+
case '--with-column-info':
|
|
177
|
+
case '-c';
|
|
178
|
+
$attributes['with-column-info'] = true;
|
|
179
|
+
break;
|
|
180
|
+
case '--with-positions':
|
|
181
|
+
case '-P':
|
|
182
|
+
$attributes['with-positions'] = true;
|
|
183
|
+
break;
|
|
184
|
+
case '--with-recovery':
|
|
185
|
+
case '-r':
|
|
186
|
+
$attributes['with-recovery'] = true;
|
|
187
|
+
break;
|
|
188
|
+
case '--help':
|
|
189
|
+
case '-h';
|
|
190
|
+
showHelp();
|
|
191
|
+
break;
|
|
192
|
+
case '--':
|
|
193
|
+
$parseOptions = false;
|
|
194
|
+
break;
|
|
195
|
+
default:
|
|
196
|
+
if ($arg[0] === '-') {
|
|
197
|
+
showHelp("Invalid operation $arg.");
|
|
198
|
+
} else {
|
|
199
|
+
$files[] = $arg;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return [$operations, $files, $attributes];
|
|
205
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nikic/php-parser",
|
|
3
|
+
"type": "library",
|
|
4
|
+
"description": "A PHP parser written in PHP",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"php",
|
|
7
|
+
"parser"
|
|
8
|
+
],
|
|
9
|
+
"license": "BSD-3-Clause",
|
|
10
|
+
"authors": [
|
|
11
|
+
{
|
|
12
|
+
"name": "Nikita Popov"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"require": {
|
|
16
|
+
"php": ">=7.0",
|
|
17
|
+
"ext-tokenizer": "*"
|
|
18
|
+
},
|
|
19
|
+
"require-dev": {
|
|
20
|
+
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0",
|
|
21
|
+
"ircmaxell/php-yacc": "^0.0.7"
|
|
22
|
+
},
|
|
23
|
+
"extra": {
|
|
24
|
+
"branch-alias": {
|
|
25
|
+
"dev-master": "4.9-dev"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"autoload": {
|
|
29
|
+
"psr-4": {
|
|
30
|
+
"PhpParser\\": "lib/PhpParser"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"autoload-dev": {
|
|
34
|
+
"psr-4": {
|
|
35
|
+
"PhpParser\\": "test/PhpParser/"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"bin": [
|
|
39
|
+
"bin/php-parse"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace PhpParser\Builder;
|
|
6
|
+
|
|
7
|
+
use PhpParser;
|
|
8
|
+
use PhpParser\BuilderHelpers;
|
|
9
|
+
use PhpParser\Node;
|
|
10
|
+
use PhpParser\Node\Const_;
|
|
11
|
+
use PhpParser\Node\Identifier;
|
|
12
|
+
use PhpParser\Node\Stmt;
|
|
13
|
+
|
|
14
|
+
class ClassConst implements PhpParser\Builder
|
|
15
|
+
{
|
|
16
|
+
protected $flags = 0;
|
|
17
|
+
protected $attributes = [];
|
|
18
|
+
protected $constants = [];
|
|
19
|
+
|
|
20
|
+
/** @var Node\AttributeGroup[] */
|
|
21
|
+
protected $attributeGroups = [];
|
|
22
|
+
/** @var Identifier|Node\Name|Node\ComplexType */
|
|
23
|
+
protected $type;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Creates a class constant builder
|
|
27
|
+
*
|
|
28
|
+
* @param string|Identifier $name Name
|
|
29
|
+
* @param Node\Expr|bool|null|int|float|string|array $value Value
|
|
30
|
+
*/
|
|
31
|
+
public function __construct($name, $value) {
|
|
32
|
+
$this->constants = [new Const_($name, BuilderHelpers::normalizeValue($value))];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Add another constant to const group
|
|
37
|
+
*
|
|
38
|
+
* @param string|Identifier $name Name
|
|
39
|
+
* @param Node\Expr|bool|null|int|float|string|array $value Value
|
|
40
|
+
*
|
|
41
|
+
* @return $this The builder instance (for fluid interface)
|
|
42
|
+
*/
|
|
43
|
+
public function addConst($name, $value) {
|
|
44
|
+
$this->constants[] = new Const_($name, BuilderHelpers::normalizeValue($value));
|
|
45
|
+
|
|
46
|
+
return $this;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Makes the constant public.
|
|
51
|
+
*
|
|
52
|
+
* @return $this The builder instance (for fluid interface)
|
|
53
|
+
*/
|
|
54
|
+
public function makePublic() {
|
|
55
|
+
$this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC);
|
|
56
|
+
|
|
57
|
+
return $this;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Makes the constant protected.
|
|
62
|
+
*
|
|
63
|
+
* @return $this The builder instance (for fluid interface)
|
|
64
|
+
*/
|
|
65
|
+
public function makeProtected() {
|
|
66
|
+
$this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED);
|
|
67
|
+
|
|
68
|
+
return $this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Makes the constant private.
|
|
73
|
+
*
|
|
74
|
+
* @return $this The builder instance (for fluid interface)
|
|
75
|
+
*/
|
|
76
|
+
public function makePrivate() {
|
|
77
|
+
$this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE);
|
|
78
|
+
|
|
79
|
+
return $this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Makes the constant final.
|
|
84
|
+
*
|
|
85
|
+
* @return $this The builder instance (for fluid interface)
|
|
86
|
+
*/
|
|
87
|
+
public function makeFinal() {
|
|
88
|
+
$this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL);
|
|
89
|
+
|
|
90
|
+
return $this;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Sets doc comment for the constant.
|
|
95
|
+
*
|
|
96
|
+
* @param PhpParser\Comment\Doc|string $docComment Doc comment to set
|
|
97
|
+
*
|
|
98
|
+
* @return $this The builder instance (for fluid interface)
|
|
99
|
+
*/
|
|
100
|
+
public function setDocComment($docComment) {
|
|
101
|
+
$this->attributes = [
|
|
102
|
+
'comments' => [BuilderHelpers::normalizeDocComment($docComment)]
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
return $this;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Adds an attribute group.
|
|
110
|
+
*
|
|
111
|
+
* @param Node\Attribute|Node\AttributeGroup $attribute
|
|
112
|
+
*
|
|
113
|
+
* @return $this The builder instance (for fluid interface)
|
|
114
|
+
*/
|
|
115
|
+
public function addAttribute($attribute) {
|
|
116
|
+
$this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);
|
|
117
|
+
|
|
118
|
+
return $this;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Sets the constant type.
|
|
123
|
+
*
|
|
124
|
+
* @param string|Node\Name|Identifier|Node\ComplexType $type
|
|
125
|
+
*
|
|
126
|
+
* @return $this
|
|
127
|
+
*/
|
|
128
|
+
public function setType($type) {
|
|
129
|
+
$this->type = BuilderHelpers::normalizeType($type);
|
|
130
|
+
|
|
131
|
+
return $this;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Returns the built class node.
|
|
136
|
+
*
|
|
137
|
+
* @return Stmt\ClassConst The built constant node
|
|
138
|
+
*/
|
|
139
|
+
public function getNode(): PhpParser\Node {
|
|
140
|
+
return new Stmt\ClassConst(
|
|
141
|
+
$this->constants,
|
|
142
|
+
$this->flags,
|
|
143
|
+
$this->attributes,
|
|
144
|
+
$this->attributeGroups,
|
|
145
|
+
$this->type
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
}
|