@appthreat/atom 2.1.19 → 2.2.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/{plugins/composer/LICENSE → LICENSE} +6 -6
- package/README.md +2 -2
- package/index.js +4 -8
- package/package.json +20 -13
- package/packages/atom-parsetools/LICENSE +21 -0
- package/{astgen.js → packages/atom-parsetools/astgen.js} +1 -1
- package/packages/atom-parsetools/index.js +1 -0
- package/{phpastgen.js → packages/atom-parsetools/phpastgen.js} +1 -1
- package/{rbastgen.js → packages/atom-parsetools/rbastgen.js} +1 -1
- package/{scalasem.js → packages/atom-parsetools/scalasem.js} +1 -1
- package/plugins/bin/atom +1 -1
- package/plugins/bin/atom.bat +1 -1
- package/plugins/lib/io.appthreat.atom-2.2.0-classpath.jar +0 -0
- package/plugins/lib/{io.appthreat.atom-2.1.19.jar → io.appthreat.atom-2.2.0.jar} +0 -0
- package/plugins/lib/{io.appthreat.c2cpg_3-2.3.10.jar → io.appthreat.c2cpg_3-2.4.1.jar} +0 -0
- package/plugins/lib/{io.appthreat.dataflowengineoss_3-2.3.10.jar → io.appthreat.dataflowengineoss_3-2.4.1.jar} +0 -0
- package/plugins/lib/{io.appthreat.javasrc2cpg_3-2.3.10.jar → io.appthreat.javasrc2cpg_3-2.4.1.jar} +0 -0
- package/plugins/lib/{io.appthreat.jimple2cpg_3-2.3.10.jar → io.appthreat.jimple2cpg_3-2.4.1.jar} +0 -0
- package/plugins/lib/{io.appthreat.jssrc2cpg_3-2.3.10.jar → io.appthreat.jssrc2cpg_3-2.4.1.jar} +0 -0
- package/plugins/lib/{io.appthreat.php2atom_3-2.3.10.jar → io.appthreat.php2atom_3-2.4.1.jar} +0 -0
- package/plugins/lib/{io.appthreat.pysrc2cpg_3-2.3.10.jar → io.appthreat.pysrc2cpg_3-2.4.1.jar} +0 -0
- package/plugins/lib/{io.appthreat.ruby2atom_3-2.3.10.jar → io.appthreat.ruby2atom_3-2.4.1.jar} +0 -0
- package/plugins/lib/{io.appthreat.semanticcpg_3-2.3.10.jar → io.appthreat.semanticcpg_3-2.4.1.jar} +0 -0
- package/plugins/lib/{io.appthreat.x2cpg_3-2.3.10.jar → io.appthreat.x2cpg_3-2.4.1.jar} +0 -0
- package/plugins/lib/{io.circe.circe-core_3-0.14.12.jar → io.circe.circe-core_3-0.14.13.jar} +0 -0
- package/plugins/lib/{io.circe.circe-generic_3-0.14.12.jar → io.circe.circe-generic_3-0.14.13.jar} +0 -0
- package/plugins/lib/{io.circe.circe-jawn_3-0.14.12.jar → io.circe.circe-jawn_3-0.14.13.jar} +0 -0
- package/plugins/lib/{io.circe.circe-numbers_3-0.14.12.jar → io.circe.circe-numbers_3-0.14.13.jar} +0 -0
- package/plugins/lib/{io.circe.circe-parser_3-0.14.12.jar → io.circe.circe-parser_3-0.14.13.jar} +0 -0
- package/plugins/lib/{org.scala-lang.scala3-library_3-3.6.2.jar → org.scala-lang.scala3-library_3-3.6.4.jar} +0 -0
- package/plugins/autoload.php +0 -22
- package/plugins/bin/bundler +0 -14
- package/plugins/bin/php-parse +0 -119
- package/plugins/bin/ruby_ast_gen +0 -14
- package/plugins/composer/ClassLoader.php +0 -579
- package/plugins/composer/InstalledVersions.php +0 -396
- package/plugins/composer/autoload_classmap.php +0 -260
- package/plugins/composer/autoload_namespaces.php +0 -9
- package/plugins/composer/autoload_psr4.php +0 -10
- package/plugins/composer/autoload_real.php +0 -36
- package/plugins/composer/autoload_static.php +0 -286
- package/plugins/composer/installed.json +0 -65
- package/plugins/composer/installed.php +0 -32
- package/plugins/lib/io.appthreat.atom-2.1.19-classpath.jar +0 -0
- package/plugins/nikic/php-parser/LICENSE +0 -29
- package/plugins/nikic/php-parser/README.md +0 -225
- package/plugins/nikic/php-parser/bin/php-parse +0 -205
- package/plugins/nikic/php-parser/composer.json +0 -41
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +0 -148
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Class_.php +0 -146
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +0 -43
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +0 -85
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +0 -117
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +0 -73
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Function_.php +0 -67
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +0 -93
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Method.php +0 -146
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +0 -45
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Param.php +0 -168
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Property.php +0 -161
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +0 -64
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +0 -148
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +0 -78
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Use_.php +0 -49
- package/plugins/nikic/php-parser/lib/PhpParser/Builder.php +0 -13
- package/plugins/nikic/php-parser/lib/PhpParser/BuilderFactory.php +0 -399
- package/plugins/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +0 -335
- package/plugins/nikic/php-parser/lib/PhpParser/Comment/Doc.php +0 -7
- package/plugins/nikic/php-parser/lib/PhpParser/Comment.php +0 -239
- package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +0 -6
- package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +0 -229
- package/plugins/nikic/php-parser/lib/PhpParser/Error.php +0 -180
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +0 -46
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +0 -18
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler.php +0 -13
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +0 -27
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/Differ.php +0 -164
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +0 -64
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +0 -286
- package/plugins/nikic/php-parser/lib/PhpParser/JsonDecoder.php +0 -103
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +0 -251
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +0 -56
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +0 -47
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +0 -31
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +0 -44
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +0 -76
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +0 -23
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +0 -62
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +0 -23
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +0 -67
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +0 -105
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php +0 -31
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +0 -36
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +0 -36
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +0 -25
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer.php +0 -560
- package/plugins/nikic/php-parser/lib/PhpParser/NameContext.php +0 -285
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Arg.php +0 -46
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Attribute.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +0 -29
- package/plugins/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +0 -14
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Const_.php +0 -37
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +0 -41
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +0 -79
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +0 -40
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +0 -39
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +0 -17
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +0 -12
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +0 -26
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +0 -36
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +0 -79
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +0 -31
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +0 -31
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +0 -39
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +0 -39
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +0 -35
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +0 -31
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +0 -45
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +0 -41
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +0 -45
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +0 -35
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +0 -35
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +0 -46
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +0 -36
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +0 -38
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr.php +0 -9
- package/plugins/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +0 -43
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Identifier.php +0 -75
- package/plugins/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +0 -31
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +0 -50
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +0 -50
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name.php +0 -254
- package/plugins/nikic/php-parser/lib/PhpParser/Node/NullableType.php +0 -28
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Param.php +0 -60
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +0 -77
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +0 -31
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +0 -80
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php +0 -16
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +0 -28
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +0 -157
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar.php +0 -7
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +0 -41
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +0 -85
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +0 -109
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +0 -161
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +0 -137
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +0 -37
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +0 -40
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +0 -33
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +0 -43
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +0 -47
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +0 -77
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +0 -31
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +0 -39
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +0 -43
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +0 -37
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +0 -31
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +0 -38
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +0 -17
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +0 -91
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +0 -37
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +0 -38
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +0 -13
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +0 -32
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +0 -38
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +0 -30
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +0 -52
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +0 -47
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +0 -34
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt.php +0 -9
- package/plugins/nikic/php-parser/lib/PhpParser/Node/UnionType.php +0 -28
- package/plugins/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +0 -17
- package/plugins/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +0 -27
- package/plugins/nikic/php-parser/lib/PhpParser/Node.php +0 -151
- package/plugins/nikic/php-parser/lib/PhpParser/NodeAbstract.php +0 -178
- package/plugins/nikic/php-parser/lib/PhpParser/NodeDumper.php +0 -206
- package/plugins/nikic/php-parser/lib/PhpParser/NodeFinder.php +0 -81
- package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverser.php +0 -291
- package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +0 -29
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +0 -20
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +0 -48
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +0 -50
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +0 -260
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +0 -52
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +0 -41
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor.php +0 -72
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +0 -25
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +0 -55
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php5.php +0 -2682
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php7.php +0 -2898
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +0 -148
- package/plugins/nikic/php-parser/lib/PhpParser/Parser.php +0 -18
- package/plugins/nikic/php-parser/lib/PhpParser/ParserAbstract.php +0 -1060
- package/plugins/nikic/php-parser/lib/PhpParser/ParserFactory.php +0 -76
- package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +0 -1126
- package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +0 -1576
- package/plugins/rubyastgen/.bundle/config +0 -5
- package/plugins/rubyastgen/Gemfile +0 -12
- package/plugins/rubyastgen/Gemfile.lock +0 -34
- package/plugins/rubyastgen/bundle/bundler/setup.rb +0 -42
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/racc +0 -29
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby-parse +0 -29
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby-rewrite +0 -29
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby_ast_gen +0 -29
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/.rspec +0 -3
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/Gemfile +0 -10
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/LICENSE.txt +0 -213
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/README.md +0 -46
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/Rakefile +0 -8
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/bin/console +0 -11
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/bin/setup +0 -6
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/exe/ruby_ast_gen +0 -59
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen/node_handling.rb +0 -232
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen/version.rb +0 -5
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen.rb +0 -140
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/ruby_ast_gen.gemspec +0 -25
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/spec/ruby_ast_gen_spec.rb +0 -175
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/spec/spec_helper.rb +0 -15
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/update_version.rb +0 -36
- 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 +0 -18
- 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 +0 -20
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/README.YARD.md +0 -12
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/node.rb +0 -268
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/processor/mixin.rb +0 -288
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/processor.rb +0 -12
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/sexp.rb +0 -30
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast.rb +0 -17
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/BSDL +0 -22
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/COPYING +0 -56
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/Gemfile +0 -10
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/README.md +0 -69
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/Rakefile +0 -18
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/bin/console +0 -14
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/bin/setup +0 -8
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/lib/ostruct.rb +0 -489
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/ostruct.gemspec +0 -24
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/LICENSE.txt +0 -26
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/bin/ruby-parse +0 -7
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/bin/ruby-rewrite +0 -7
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/gauntlet_parser.rb +0 -123
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/all.rb +0 -17
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ast/node.rb +0 -40
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ast/processor.rb +0 -293
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/base.rb +0 -294
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/builders/default.rb +0 -2351
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/clobbering_error.rb +0 -13
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/color.rb +0 -32
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/context.rb +0 -51
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/current.rb +0 -146
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/current_arg_stack.rb +0 -46
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/deprecation.rb +0 -13
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/diagnostic/engine.rb +0 -104
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/diagnostic.rb +0 -163
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/dedenter.rb +0 -88
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/explanation.rb +0 -55
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/literal.rb +0 -284
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/stack_state.rb +0 -49
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-F0.rb +0 -12931
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-F1.rb +0 -14884
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-strings.rb +0 -5433
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/macruby.rb +0 -9634
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/max_numparam_stack.rb +0 -56
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/messages.rb +0 -125
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/meta.rb +0 -48
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/rewriter.rb +0 -105
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby18.rb +0 -9272
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby19.rb +0 -9558
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby20.rb +0 -10229
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby21.rb +0 -10203
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby22.rb +0 -10302
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby23.rb +0 -10322
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby24.rb +0 -10454
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby25.rb +0 -10374
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby26.rb +0 -10352
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby27.rb +0 -11948
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby30.rb +0 -12244
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby31.rb +0 -12717
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby32.rb +0 -12705
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby33.rb +0 -12590
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby34.rb +0 -12597
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/rubymotion.rb +0 -9515
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner/ruby_parse.rb +0 -157
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner/ruby_rewrite.rb +0 -101
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner.rb +0 -299
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/buffer.rb +0 -369
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/comment/associator.rb +0 -233
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/comment.rb +0 -134
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/collection.rb +0 -18
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/condition.rb +0 -21
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/constant.rb +0 -32
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/definition.rb +0 -23
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/for.rb +0 -19
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/heredoc.rb +0 -19
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/index.rb +0 -33
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/keyword.rb +0 -20
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/method_definition.rb +0 -25
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/objc_kwarg.rb +0 -19
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/operator.rb +0 -17
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/rescue_body.rb +0 -21
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/send.rb +0 -36
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/ternary.rb +0 -18
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/variable.rb +0 -31
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map.rb +0 -186
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/range.rb +0 -326
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/rewriter/action.rb +0 -44
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/rewriter.rb +0 -513
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/tree_rewriter/action.rb +0 -243
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/tree_rewriter.rb +0 -431
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/static_environment.rb +0 -134
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/syntax_error.rb +0 -21
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/tree_rewriter.rb +0 -133
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/unknown_encoding_in_magic_comment_error.rb +0 -15
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/variables_stack.rb +0 -36
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/version.rb +0 -5
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser.rb +0 -91
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/parser.gemspec +0 -43
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/BSDL +0 -22
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/COPYING +0 -56
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ChangeLog +0 -846
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/README.ja.rdoc +0 -58
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/README.rdoc +0 -60
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/TODO +0 -5
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/bin/racc +0 -320
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/en/grammar.en.rdoc +0 -218
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/en/grammar2.en.rdoc +0 -219
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/command.ja.html +0 -99
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/debug.ja.rdoc +0 -36
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/grammar.ja.rdoc +0 -348
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/index.ja.html +0 -10
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/parser.ja.rdoc +0 -125
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/usage.ja.html +0 -414
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/Makefile +0 -273
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/cparse.c +0 -840
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/extconf.rb +0 -8
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/compat.rb +0 -33
- 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 +0 -60
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/exception.rb +0 -16
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/grammar.rb +0 -1191
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/grammarfileparser.rb +0 -667
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/info.rb +0 -18
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/iset.rb +0 -92
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/logfilegenerator.rb +0 -212
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parser-text.rb +0 -644
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parser.rb +0 -630
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parserfilegenerator.rb +0 -473
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/sourcetext.rb +0 -35
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/state.rb +0 -976
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/statetransitiontable.rb +0 -311
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/static.rb +0 -5
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc.rb +0 -6
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/ast-2.4.3.gemspec +0 -29
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/ostruct-0.6.1.gemspec +0 -21
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/parser-3.3.8.0.gemspec +0 -37
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +0 -28
- package/plugins/rubyastgen/setup.ps1 +0 -4
- package/plugins/rubyastgen/setup.sh +0 -6
- package/utils.mjs +0 -139
|
@@ -1,1191 +0,0 @@
|
|
|
1
|
-
#--
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
# Copyright (c) 1999-2006 Minero Aoki
|
|
6
|
-
#
|
|
7
|
-
# This program is free software.
|
|
8
|
-
# You can distribute/modify this program under the same terms of ruby.
|
|
9
|
-
# see the file "COPYING".
|
|
10
|
-
#
|
|
11
|
-
#++
|
|
12
|
-
|
|
13
|
-
require_relative 'compat'
|
|
14
|
-
require_relative 'iset'
|
|
15
|
-
require_relative 'sourcetext'
|
|
16
|
-
require_relative 'logfilegenerator'
|
|
17
|
-
require_relative 'exception'
|
|
18
|
-
require 'forwardable'
|
|
19
|
-
|
|
20
|
-
module Racc
|
|
21
|
-
|
|
22
|
-
class Grammar
|
|
23
|
-
|
|
24
|
-
def initialize(debug_flags = DebugFlags.new)
|
|
25
|
-
@symboltable = SymbolTable.new
|
|
26
|
-
@debug_symbol = debug_flags.token
|
|
27
|
-
@rules = [] # :: [Rule]
|
|
28
|
-
@start = nil
|
|
29
|
-
@n_expected_srconflicts = nil
|
|
30
|
-
@error_on_expect_mismatch = nil
|
|
31
|
-
@prec_table = []
|
|
32
|
-
@prec_table_closed = false
|
|
33
|
-
@closed = false
|
|
34
|
-
@states = nil
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
attr_reader :start
|
|
38
|
-
attr_reader :symboltable
|
|
39
|
-
attr_accessor :n_expected_srconflicts
|
|
40
|
-
attr_accessor :error_on_expect_mismatch
|
|
41
|
-
|
|
42
|
-
def [](x)
|
|
43
|
-
@rules[x]
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def each_rule(&block)
|
|
47
|
-
@rules.each(&block)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
alias each each_rule
|
|
51
|
-
|
|
52
|
-
def each_index(&block)
|
|
53
|
-
@rules.each_index(&block)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def each_with_index(&block)
|
|
57
|
-
@rules.each_with_index(&block)
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def size
|
|
61
|
-
@rules.size
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def to_s
|
|
65
|
-
"<Racc::Grammar>"
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
extend Forwardable
|
|
69
|
-
|
|
70
|
-
def_delegator "@symboltable", :each, :each_symbol
|
|
71
|
-
def_delegator "@symboltable", :each_terminal
|
|
72
|
-
def_delegator "@symboltable", :each_nonterminal
|
|
73
|
-
|
|
74
|
-
def intern(value, dummy = false)
|
|
75
|
-
@symboltable.intern(value, dummy)
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def symbols
|
|
79
|
-
@symboltable.symbols
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def nonterminal_base
|
|
83
|
-
@symboltable.nt_base
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
def useless_nonterminal_exist?
|
|
87
|
-
n_useless_nonterminals() != 0
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def n_useless_nonterminals
|
|
91
|
-
@n_useless_nonterminals ||= each_useless_nonterminal.count
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def each_useless_nonterminal
|
|
95
|
-
return to_enum __method__ unless block_given?
|
|
96
|
-
|
|
97
|
-
@symboltable.each_nonterminal do |sym|
|
|
98
|
-
yield sym if sym.useless?
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def useless_rule_exist?
|
|
103
|
-
n_useless_rules() != 0
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
def n_useless_rules
|
|
107
|
-
@n_useless_rules ||= each_useless_rule.count
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
def each_useless_rule
|
|
111
|
-
return to_enum __method__ unless block_given?
|
|
112
|
-
|
|
113
|
-
each do |r|
|
|
114
|
-
yield r if r.useless?
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
def nfa
|
|
119
|
-
(@states ||= States.new(self)).nfa
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
def dfa
|
|
123
|
-
(@states ||= States.new(self)).dfa
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
alias states dfa
|
|
127
|
-
|
|
128
|
-
def state_transition_table
|
|
129
|
-
states().state_transition_table
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
def parser_class
|
|
133
|
-
states = states() # cache
|
|
134
|
-
if $DEBUG
|
|
135
|
-
srcfilename = caller(1).first.slice(/\A(.*?):/, 1)
|
|
136
|
-
begin
|
|
137
|
-
write_log srcfilename + ".output"
|
|
138
|
-
rescue SystemCallError
|
|
139
|
-
end
|
|
140
|
-
report = lambda {|s| $stderr.puts "racc: #{srcfilename}: #{s}" }
|
|
141
|
-
if states.should_report_srconflict?
|
|
142
|
-
report["#{states.n_srconflicts} shift/reduce conflicts"]
|
|
143
|
-
end
|
|
144
|
-
if states.rrconflict_exist?
|
|
145
|
-
report["#{states.n_rrconflicts} reduce/reduce conflicts"]
|
|
146
|
-
end
|
|
147
|
-
g = states.grammar
|
|
148
|
-
if g.useless_nonterminal_exist?
|
|
149
|
-
report["#{g.n_useless_nonterminals} useless nonterminals"]
|
|
150
|
-
end
|
|
151
|
-
if g.useless_rule_exist?
|
|
152
|
-
report["#{g.n_useless_rules} useless rules"]
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
states.state_transition_table.parser_class
|
|
156
|
-
end
|
|
157
|
-
|
|
158
|
-
def write_log(path)
|
|
159
|
-
File.open(path, 'w') {|f|
|
|
160
|
-
LogFileGenerator.new(states()).output f
|
|
161
|
-
}
|
|
162
|
-
end
|
|
163
|
-
|
|
164
|
-
#
|
|
165
|
-
# Grammar Definition Interface
|
|
166
|
-
#
|
|
167
|
-
|
|
168
|
-
def add(rule)
|
|
169
|
-
raise ArgumentError, "rule added after the Grammar closed" if @closed
|
|
170
|
-
@rules.push rule
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
def added?(sym)
|
|
174
|
-
@rules.detect {|r| r.target == sym }
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
def start_symbol=(s)
|
|
178
|
-
raise CompileError, "start symbol set twice'" if @start
|
|
179
|
-
@start = s
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
def declare_precedence(assoc, syms)
|
|
183
|
-
raise CompileError, "precedence table defined twice" if @prec_table_closed
|
|
184
|
-
@prec_table.push [assoc, syms]
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
def end_precedence_declaration(reverse)
|
|
188
|
-
@prec_table_closed = true
|
|
189
|
-
return if @prec_table.empty?
|
|
190
|
-
table = reverse ? @prec_table.reverse : @prec_table
|
|
191
|
-
table.each_with_index do |(assoc, syms), idx|
|
|
192
|
-
syms.each do |sym|
|
|
193
|
-
sym.assoc = assoc
|
|
194
|
-
sym.precedence = idx
|
|
195
|
-
end
|
|
196
|
-
end
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
#
|
|
200
|
-
# Dynamic Generation Interface
|
|
201
|
-
#
|
|
202
|
-
|
|
203
|
-
def Grammar.define(&block)
|
|
204
|
-
env = DefinitionEnv.new
|
|
205
|
-
env.instance_eval(&block)
|
|
206
|
-
env.grammar
|
|
207
|
-
end
|
|
208
|
-
|
|
209
|
-
class DefinitionEnv
|
|
210
|
-
def initialize
|
|
211
|
-
@grammar = Grammar.new
|
|
212
|
-
@seqs = Hash.new(0)
|
|
213
|
-
@delayed = []
|
|
214
|
-
end
|
|
215
|
-
|
|
216
|
-
def grammar
|
|
217
|
-
flush_delayed
|
|
218
|
-
@grammar.each do |rule|
|
|
219
|
-
if rule.specified_prec
|
|
220
|
-
rule.specified_prec = @grammar.intern(rule.specified_prec)
|
|
221
|
-
end
|
|
222
|
-
end
|
|
223
|
-
@grammar.init
|
|
224
|
-
@grammar
|
|
225
|
-
end
|
|
226
|
-
|
|
227
|
-
def precedence_table(&block)
|
|
228
|
-
env = PrecedenceDefinitionEnv.new(@grammar)
|
|
229
|
-
env.instance_eval(&block)
|
|
230
|
-
@grammar.end_precedence_declaration env.reverse
|
|
231
|
-
end
|
|
232
|
-
|
|
233
|
-
def method_missing(mid, *args, &block)
|
|
234
|
-
unless mid.to_s[-1,1] == '='
|
|
235
|
-
super # raises NoMethodError
|
|
236
|
-
end
|
|
237
|
-
target = @grammar.intern(mid.to_s.chop.intern)
|
|
238
|
-
unless args.size == 1
|
|
239
|
-
raise ArgumentError, "too many arguments for #{mid} (#{args.size} for 1)"
|
|
240
|
-
end
|
|
241
|
-
_add target, args.first
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
def _add(target, x)
|
|
245
|
-
case x
|
|
246
|
-
when Sym
|
|
247
|
-
@delayed.each do |rule|
|
|
248
|
-
rule.replace x, target if rule.target == x
|
|
249
|
-
end
|
|
250
|
-
@grammar.symboltable.delete x
|
|
251
|
-
else
|
|
252
|
-
x.each_rule do |r|
|
|
253
|
-
r.target = target
|
|
254
|
-
@grammar.add r
|
|
255
|
-
end
|
|
256
|
-
end
|
|
257
|
-
flush_delayed
|
|
258
|
-
end
|
|
259
|
-
|
|
260
|
-
def _delayed_add(rule)
|
|
261
|
-
@delayed.push rule
|
|
262
|
-
end
|
|
263
|
-
|
|
264
|
-
def _added?(sym)
|
|
265
|
-
@grammar.added?(sym) or @delayed.detect {|r| r.target == sym }
|
|
266
|
-
end
|
|
267
|
-
|
|
268
|
-
def flush_delayed
|
|
269
|
-
return if @delayed.empty?
|
|
270
|
-
@delayed.each do |rule|
|
|
271
|
-
@grammar.add rule
|
|
272
|
-
end
|
|
273
|
-
@delayed.clear
|
|
274
|
-
end
|
|
275
|
-
|
|
276
|
-
def seq(*list, &block)
|
|
277
|
-
Rule.new(nil, list.map {|x| _intern(x) }, UserAction.proc(block))
|
|
278
|
-
end
|
|
279
|
-
|
|
280
|
-
def null(&block)
|
|
281
|
-
seq(&block)
|
|
282
|
-
end
|
|
283
|
-
|
|
284
|
-
def action(&block)
|
|
285
|
-
id = "@#{@seqs["action"] += 1}".intern
|
|
286
|
-
_delayed_add Rule.new(@grammar.intern(id), [], UserAction.proc(block))
|
|
287
|
-
id
|
|
288
|
-
end
|
|
289
|
-
|
|
290
|
-
alias _ action
|
|
291
|
-
|
|
292
|
-
def option(sym, default = nil, &block)
|
|
293
|
-
_defmetasyntax("option", _intern(sym), block) {|target|
|
|
294
|
-
seq() { default } | seq(sym)
|
|
295
|
-
}
|
|
296
|
-
end
|
|
297
|
-
|
|
298
|
-
def many(sym, &block)
|
|
299
|
-
_defmetasyntax("many", _intern(sym), block) {|target|
|
|
300
|
-
seq() { [] }\
|
|
301
|
-
| seq(target, sym) {|list, x| list.push x; list }
|
|
302
|
-
}
|
|
303
|
-
end
|
|
304
|
-
|
|
305
|
-
def many1(sym, &block)
|
|
306
|
-
_defmetasyntax("many1", _intern(sym), block) {|target|
|
|
307
|
-
seq(sym) {|x| [x] }\
|
|
308
|
-
| seq(target, sym) {|list, x| list.push x; list }
|
|
309
|
-
}
|
|
310
|
-
end
|
|
311
|
-
|
|
312
|
-
def separated_by(sep, sym, &block)
|
|
313
|
-
option(separated_by1(sep, sym), [], &block)
|
|
314
|
-
end
|
|
315
|
-
|
|
316
|
-
def separated_by1(sep, sym, &block)
|
|
317
|
-
_defmetasyntax("separated_by1", _intern(sym), block) {|target|
|
|
318
|
-
seq(sym) {|x| [x] }\
|
|
319
|
-
| seq(target, sep, sym) {|list, _, x| list.push x; list }
|
|
320
|
-
}
|
|
321
|
-
end
|
|
322
|
-
|
|
323
|
-
def _intern(x)
|
|
324
|
-
case x
|
|
325
|
-
when Symbol, String
|
|
326
|
-
@grammar.intern(x)
|
|
327
|
-
when Racc::Sym
|
|
328
|
-
x
|
|
329
|
-
else
|
|
330
|
-
raise TypeError, "wrong type #{x.class} (expected Symbol/String/Racc::Sym)"
|
|
331
|
-
end
|
|
332
|
-
end
|
|
333
|
-
|
|
334
|
-
private
|
|
335
|
-
|
|
336
|
-
def _defmetasyntax(type, id, action, &block)
|
|
337
|
-
if action
|
|
338
|
-
idbase = "#{type}@#{id}-#{@seqs[type] += 1}"
|
|
339
|
-
target = _wrap(idbase, "#{idbase}-core", action)
|
|
340
|
-
_register("#{idbase}-core", &block)
|
|
341
|
-
else
|
|
342
|
-
target = _register("#{type}@#{id}", &block)
|
|
343
|
-
end
|
|
344
|
-
@grammar.intern(target)
|
|
345
|
-
end
|
|
346
|
-
|
|
347
|
-
def _register(target_name)
|
|
348
|
-
target = target_name.intern
|
|
349
|
-
unless _added?(@grammar.intern(target))
|
|
350
|
-
yield(target).each_rule do |rule|
|
|
351
|
-
rule.target = @grammar.intern(target)
|
|
352
|
-
_delayed_add rule
|
|
353
|
-
end
|
|
354
|
-
end
|
|
355
|
-
target
|
|
356
|
-
end
|
|
357
|
-
|
|
358
|
-
def _wrap(target_name, sym, block)
|
|
359
|
-
target = target_name.intern
|
|
360
|
-
_delayed_add Rule.new(@grammar.intern(target),
|
|
361
|
-
[@grammar.intern(sym.intern)],
|
|
362
|
-
UserAction.proc(block))
|
|
363
|
-
target
|
|
364
|
-
end
|
|
365
|
-
end
|
|
366
|
-
|
|
367
|
-
class PrecedenceDefinitionEnv
|
|
368
|
-
def initialize(g)
|
|
369
|
-
@grammar = g
|
|
370
|
-
@prechigh_seen = false
|
|
371
|
-
@preclow_seen = false
|
|
372
|
-
@reverse = false
|
|
373
|
-
end
|
|
374
|
-
|
|
375
|
-
attr_reader :reverse
|
|
376
|
-
|
|
377
|
-
def higher
|
|
378
|
-
if @prechigh_seen
|
|
379
|
-
raise CompileError, "prechigh used twice"
|
|
380
|
-
end
|
|
381
|
-
@prechigh_seen = true
|
|
382
|
-
end
|
|
383
|
-
|
|
384
|
-
def lower
|
|
385
|
-
if @preclow_seen
|
|
386
|
-
raise CompileError, "preclow used twice"
|
|
387
|
-
end
|
|
388
|
-
if @prechigh_seen
|
|
389
|
-
@reverse = true
|
|
390
|
-
end
|
|
391
|
-
@preclow_seen = true
|
|
392
|
-
end
|
|
393
|
-
|
|
394
|
-
def left(*syms)
|
|
395
|
-
@grammar.declare_precedence :Left, syms.map {|s| @grammar.intern(s) }
|
|
396
|
-
end
|
|
397
|
-
|
|
398
|
-
def right(*syms)
|
|
399
|
-
@grammar.declare_precedence :Right, syms.map {|s| @grammar.intern(s) }
|
|
400
|
-
end
|
|
401
|
-
|
|
402
|
-
def nonassoc(*syms)
|
|
403
|
-
@grammar.declare_precedence :Nonassoc, syms.map {|s| @grammar.intern(s)}
|
|
404
|
-
end
|
|
405
|
-
end
|
|
406
|
-
|
|
407
|
-
#
|
|
408
|
-
# Computation
|
|
409
|
-
#
|
|
410
|
-
|
|
411
|
-
def init
|
|
412
|
-
return if @closed
|
|
413
|
-
@closed = true
|
|
414
|
-
@start ||= @rules.map {|r| r.target }.detect {|sym| not sym.dummy? }
|
|
415
|
-
raise CompileError, 'no rule in input' if @rules.empty?
|
|
416
|
-
add_start_rule
|
|
417
|
-
@rules.freeze
|
|
418
|
-
fix_ident
|
|
419
|
-
compute_hash
|
|
420
|
-
compute_heads
|
|
421
|
-
determine_terminals
|
|
422
|
-
compute_nullable_0
|
|
423
|
-
@symboltable.fix
|
|
424
|
-
compute_locate
|
|
425
|
-
@symboltable.each_nonterminal {|t| compute_expand t }
|
|
426
|
-
compute_nullable
|
|
427
|
-
compute_useless
|
|
428
|
-
end
|
|
429
|
-
|
|
430
|
-
private
|
|
431
|
-
|
|
432
|
-
def add_start_rule
|
|
433
|
-
r = Rule.new(@symboltable.dummy,
|
|
434
|
-
[@start, @symboltable.anchor, @symboltable.anchor],
|
|
435
|
-
UserAction.empty)
|
|
436
|
-
r.ident = 0
|
|
437
|
-
r.hash = 0
|
|
438
|
-
r.precedence = nil
|
|
439
|
-
@rules.unshift r
|
|
440
|
-
end
|
|
441
|
-
|
|
442
|
-
# Rule#ident
|
|
443
|
-
# LocationPointer#ident
|
|
444
|
-
def fix_ident
|
|
445
|
-
@rules.each_with_index do |rule, idx|
|
|
446
|
-
rule.ident = idx
|
|
447
|
-
end
|
|
448
|
-
end
|
|
449
|
-
|
|
450
|
-
# Rule#hash
|
|
451
|
-
def compute_hash
|
|
452
|
-
hash = 4 # size of dummy rule
|
|
453
|
-
@rules.each do |rule|
|
|
454
|
-
rule.hash = hash
|
|
455
|
-
hash += (rule.size + 1)
|
|
456
|
-
end
|
|
457
|
-
end
|
|
458
|
-
|
|
459
|
-
# Sym#heads
|
|
460
|
-
def compute_heads
|
|
461
|
-
@rules.each do |rule|
|
|
462
|
-
rule.target.heads.push rule.ptrs[0]
|
|
463
|
-
end
|
|
464
|
-
end
|
|
465
|
-
|
|
466
|
-
# Sym#terminal?
|
|
467
|
-
def determine_terminals
|
|
468
|
-
@symboltable.each do |s|
|
|
469
|
-
s.term = s.heads.empty?
|
|
470
|
-
end
|
|
471
|
-
end
|
|
472
|
-
|
|
473
|
-
# Sym#self_null?
|
|
474
|
-
def compute_nullable_0
|
|
475
|
-
@symboltable.each do |s|
|
|
476
|
-
if s.terminal?
|
|
477
|
-
s.snull = false
|
|
478
|
-
else
|
|
479
|
-
s.snull = s.heads.any? {|loc| loc.reduce? }
|
|
480
|
-
end
|
|
481
|
-
end
|
|
482
|
-
end
|
|
483
|
-
|
|
484
|
-
# Sym#locate
|
|
485
|
-
def compute_locate
|
|
486
|
-
@rules.each do |rule|
|
|
487
|
-
t = nil
|
|
488
|
-
rule.ptrs.each do |ptr|
|
|
489
|
-
unless ptr.reduce?
|
|
490
|
-
tok = ptr.dereference
|
|
491
|
-
tok.locate.push ptr
|
|
492
|
-
t = tok if tok.terminal?
|
|
493
|
-
end
|
|
494
|
-
end
|
|
495
|
-
rule.precedence = t
|
|
496
|
-
end
|
|
497
|
-
end
|
|
498
|
-
|
|
499
|
-
# Sym#expand
|
|
500
|
-
def compute_expand(t)
|
|
501
|
-
puts "expand> #{t.to_s}" if @debug_symbol
|
|
502
|
-
t.expand = _compute_expand(t, ISet.new, [])
|
|
503
|
-
puts "expand< #{t.to_s}: #{t.expand.to_s}" if @debug_symbol
|
|
504
|
-
end
|
|
505
|
-
|
|
506
|
-
def _compute_expand(t, set, lock)
|
|
507
|
-
if tmp = t.expand
|
|
508
|
-
set.update tmp
|
|
509
|
-
return set
|
|
510
|
-
end
|
|
511
|
-
tok = nil
|
|
512
|
-
set.update_a t.heads
|
|
513
|
-
t.heads.each do |ptr|
|
|
514
|
-
tok = ptr.dereference
|
|
515
|
-
if tok and tok.nonterminal?
|
|
516
|
-
unless lock[tok.ident]
|
|
517
|
-
lock[tok.ident] = true
|
|
518
|
-
_compute_expand tok, set, lock
|
|
519
|
-
end
|
|
520
|
-
end
|
|
521
|
-
end
|
|
522
|
-
set
|
|
523
|
-
end
|
|
524
|
-
|
|
525
|
-
# Sym#nullable?, Rule#nullable?
|
|
526
|
-
def compute_nullable
|
|
527
|
-
@rules.each {|r| r.null = false }
|
|
528
|
-
@symboltable.each {|t| t.null = false }
|
|
529
|
-
r = @rules.dup
|
|
530
|
-
s = @symboltable.nonterminals
|
|
531
|
-
begin
|
|
532
|
-
rs = r.size
|
|
533
|
-
ss = s.size
|
|
534
|
-
check_rules_nullable r
|
|
535
|
-
check_symbols_nullable s
|
|
536
|
-
end until rs == r.size and ss == s.size
|
|
537
|
-
end
|
|
538
|
-
|
|
539
|
-
def check_rules_nullable(rules)
|
|
540
|
-
rules.delete_if do |rule|
|
|
541
|
-
rule.null = true
|
|
542
|
-
rule.symbols.each do |t|
|
|
543
|
-
unless t.nullable?
|
|
544
|
-
rule.null = false
|
|
545
|
-
break
|
|
546
|
-
end
|
|
547
|
-
end
|
|
548
|
-
rule.nullable?
|
|
549
|
-
end
|
|
550
|
-
end
|
|
551
|
-
|
|
552
|
-
def check_symbols_nullable(symbols)
|
|
553
|
-
symbols.delete_if do |sym|
|
|
554
|
-
sym.heads.each do |ptr|
|
|
555
|
-
if ptr.rule.nullable?
|
|
556
|
-
sym.null = true
|
|
557
|
-
break
|
|
558
|
-
end
|
|
559
|
-
end
|
|
560
|
-
sym.nullable?
|
|
561
|
-
end
|
|
562
|
-
end
|
|
563
|
-
|
|
564
|
-
# Sym#useless?, Rule#useless?
|
|
565
|
-
# FIXME: what means "useless"?
|
|
566
|
-
def compute_useless
|
|
567
|
-
@symboltable.each_terminal {|sym| sym.useless = false }
|
|
568
|
-
@symboltable.each_nonterminal {|sym| sym.useless = true }
|
|
569
|
-
@rules.each {|rule| rule.useless = true }
|
|
570
|
-
r = @rules.dup
|
|
571
|
-
s = @symboltable.nonterminals
|
|
572
|
-
begin
|
|
573
|
-
rs = r.size
|
|
574
|
-
ss = s.size
|
|
575
|
-
check_rules_useless r
|
|
576
|
-
check_symbols_useless s
|
|
577
|
-
end until r.size == rs and s.size == ss
|
|
578
|
-
end
|
|
579
|
-
|
|
580
|
-
def check_rules_useless(rules)
|
|
581
|
-
rules.delete_if do |rule|
|
|
582
|
-
rule.useless = false
|
|
583
|
-
rule.symbols.each do |sym|
|
|
584
|
-
if sym.useless?
|
|
585
|
-
rule.useless = true
|
|
586
|
-
break
|
|
587
|
-
end
|
|
588
|
-
end
|
|
589
|
-
not rule.useless?
|
|
590
|
-
end
|
|
591
|
-
end
|
|
592
|
-
|
|
593
|
-
def check_symbols_useless(s)
|
|
594
|
-
s.delete_if do |t|
|
|
595
|
-
t.heads.each do |ptr|
|
|
596
|
-
unless ptr.rule.useless?
|
|
597
|
-
t.useless = false
|
|
598
|
-
break
|
|
599
|
-
end
|
|
600
|
-
end
|
|
601
|
-
not t.useless?
|
|
602
|
-
end
|
|
603
|
-
end
|
|
604
|
-
|
|
605
|
-
end # class Grammar
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
class Rule
|
|
609
|
-
|
|
610
|
-
def initialize(target, syms, act)
|
|
611
|
-
@target = target
|
|
612
|
-
@symbols = syms
|
|
613
|
-
@action = act
|
|
614
|
-
@alternatives = []
|
|
615
|
-
|
|
616
|
-
@ident = nil
|
|
617
|
-
@hash = nil
|
|
618
|
-
@ptrs = nil
|
|
619
|
-
@precedence = nil
|
|
620
|
-
@specified_prec = nil
|
|
621
|
-
@null = nil
|
|
622
|
-
@useless = nil
|
|
623
|
-
end
|
|
624
|
-
|
|
625
|
-
attr_accessor :target
|
|
626
|
-
attr_reader :symbols
|
|
627
|
-
attr_reader :action
|
|
628
|
-
|
|
629
|
-
def |(x)
|
|
630
|
-
@alternatives.push x.rule
|
|
631
|
-
self
|
|
632
|
-
end
|
|
633
|
-
|
|
634
|
-
def rule
|
|
635
|
-
self
|
|
636
|
-
end
|
|
637
|
-
|
|
638
|
-
def each_rule(&block)
|
|
639
|
-
yield self
|
|
640
|
-
@alternatives.each(&block)
|
|
641
|
-
end
|
|
642
|
-
|
|
643
|
-
attr_accessor :ident
|
|
644
|
-
|
|
645
|
-
attr_reader :hash
|
|
646
|
-
attr_reader :ptrs
|
|
647
|
-
|
|
648
|
-
def hash=(n)
|
|
649
|
-
@hash = n
|
|
650
|
-
ptrs = []
|
|
651
|
-
@symbols.each_with_index do |sym, idx|
|
|
652
|
-
ptrs.push LocationPointer.new(self, idx, sym)
|
|
653
|
-
end
|
|
654
|
-
ptrs.push LocationPointer.new(self, @symbols.size, nil)
|
|
655
|
-
@ptrs = ptrs
|
|
656
|
-
end
|
|
657
|
-
|
|
658
|
-
def precedence
|
|
659
|
-
@specified_prec || @precedence
|
|
660
|
-
end
|
|
661
|
-
|
|
662
|
-
def precedence=(sym)
|
|
663
|
-
@precedence ||= sym
|
|
664
|
-
end
|
|
665
|
-
|
|
666
|
-
def prec(sym, &block)
|
|
667
|
-
@specified_prec = sym
|
|
668
|
-
if block
|
|
669
|
-
unless @action.empty?
|
|
670
|
-
raise CompileError, 'both of rule action block and prec block given'
|
|
671
|
-
end
|
|
672
|
-
@action = UserAction.proc(block)
|
|
673
|
-
end
|
|
674
|
-
self
|
|
675
|
-
end
|
|
676
|
-
|
|
677
|
-
attr_accessor :specified_prec
|
|
678
|
-
|
|
679
|
-
def nullable?() @null end
|
|
680
|
-
def null=(n) @null = n end
|
|
681
|
-
|
|
682
|
-
def useless?() @useless end
|
|
683
|
-
def useless=(u) @useless = u end
|
|
684
|
-
|
|
685
|
-
def inspect
|
|
686
|
-
"#<Racc::Rule id=#{@ident} (#{@target})>"
|
|
687
|
-
end
|
|
688
|
-
|
|
689
|
-
def ==(other)
|
|
690
|
-
other.kind_of?(Rule) and @ident == other.ident
|
|
691
|
-
end
|
|
692
|
-
|
|
693
|
-
def [](idx)
|
|
694
|
-
@symbols[idx]
|
|
695
|
-
end
|
|
696
|
-
|
|
697
|
-
def size
|
|
698
|
-
@symbols.size
|
|
699
|
-
end
|
|
700
|
-
|
|
701
|
-
def empty?
|
|
702
|
-
@symbols.empty?
|
|
703
|
-
end
|
|
704
|
-
|
|
705
|
-
def to_s
|
|
706
|
-
"#<rule#{@ident}>"
|
|
707
|
-
end
|
|
708
|
-
|
|
709
|
-
def accept?
|
|
710
|
-
if tok = @symbols[-1]
|
|
711
|
-
tok.anchor?
|
|
712
|
-
else
|
|
713
|
-
false
|
|
714
|
-
end
|
|
715
|
-
end
|
|
716
|
-
|
|
717
|
-
def each(&block)
|
|
718
|
-
@symbols.each(&block)
|
|
719
|
-
end
|
|
720
|
-
|
|
721
|
-
def replace(src, dest)
|
|
722
|
-
@target = dest
|
|
723
|
-
@symbols = @symbols.map {|s| s == src ? dest : s }
|
|
724
|
-
end
|
|
725
|
-
|
|
726
|
-
end # class Rule
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
class UserAction
|
|
730
|
-
|
|
731
|
-
def UserAction.source_text(src)
|
|
732
|
-
new(src, nil)
|
|
733
|
-
end
|
|
734
|
-
|
|
735
|
-
def UserAction.proc(pr = nil, &block)
|
|
736
|
-
if pr and block
|
|
737
|
-
raise ArgumentError, "both of argument and block given"
|
|
738
|
-
end
|
|
739
|
-
new(nil, pr || block)
|
|
740
|
-
end
|
|
741
|
-
|
|
742
|
-
def UserAction.empty
|
|
743
|
-
new(nil, nil)
|
|
744
|
-
end
|
|
745
|
-
|
|
746
|
-
private_class_method :new
|
|
747
|
-
|
|
748
|
-
def initialize(src, proc)
|
|
749
|
-
@source = src
|
|
750
|
-
@proc = proc
|
|
751
|
-
end
|
|
752
|
-
|
|
753
|
-
attr_reader :source
|
|
754
|
-
attr_reader :proc
|
|
755
|
-
|
|
756
|
-
def source?
|
|
757
|
-
not @proc
|
|
758
|
-
end
|
|
759
|
-
|
|
760
|
-
def proc?
|
|
761
|
-
not @source
|
|
762
|
-
end
|
|
763
|
-
|
|
764
|
-
def empty?
|
|
765
|
-
not @proc and not @source
|
|
766
|
-
end
|
|
767
|
-
|
|
768
|
-
def name
|
|
769
|
-
"{action type=#{@source || @proc || 'nil'}}"
|
|
770
|
-
end
|
|
771
|
-
|
|
772
|
-
alias inspect name
|
|
773
|
-
|
|
774
|
-
end
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
class OrMark
|
|
778
|
-
def initialize(lineno)
|
|
779
|
-
@lineno = lineno
|
|
780
|
-
end
|
|
781
|
-
|
|
782
|
-
def name
|
|
783
|
-
'|'
|
|
784
|
-
end
|
|
785
|
-
|
|
786
|
-
alias inspect name
|
|
787
|
-
|
|
788
|
-
attr_reader :lineno
|
|
789
|
-
end
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
class OptionMark
|
|
793
|
-
def initialize(lineno)
|
|
794
|
-
@lineno = lineno
|
|
795
|
-
end
|
|
796
|
-
|
|
797
|
-
def name
|
|
798
|
-
'?'
|
|
799
|
-
end
|
|
800
|
-
|
|
801
|
-
alias inspect name
|
|
802
|
-
|
|
803
|
-
attr_reader :lineno
|
|
804
|
-
end
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
class ManyMark
|
|
808
|
-
def initialize(lineno)
|
|
809
|
-
@lineno = lineno
|
|
810
|
-
end
|
|
811
|
-
|
|
812
|
-
def name
|
|
813
|
-
'*'
|
|
814
|
-
end
|
|
815
|
-
|
|
816
|
-
alias inspect name
|
|
817
|
-
|
|
818
|
-
attr_reader :lineno
|
|
819
|
-
end
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
class Many1Mark
|
|
823
|
-
def initialize(lineno)
|
|
824
|
-
@lineno = lineno
|
|
825
|
-
end
|
|
826
|
-
|
|
827
|
-
def name
|
|
828
|
-
'+'
|
|
829
|
-
end
|
|
830
|
-
|
|
831
|
-
alias inspect name
|
|
832
|
-
|
|
833
|
-
attr_reader :lineno
|
|
834
|
-
end
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
class GroupStartMark
|
|
838
|
-
def initialize(lineno)
|
|
839
|
-
@lineno = lineno
|
|
840
|
-
end
|
|
841
|
-
|
|
842
|
-
def name
|
|
843
|
-
'('
|
|
844
|
-
end
|
|
845
|
-
|
|
846
|
-
alias inspect name
|
|
847
|
-
|
|
848
|
-
attr_reader :lineno
|
|
849
|
-
end
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
class GroupEndMark
|
|
853
|
-
def initialize(lineno)
|
|
854
|
-
@lineno = lineno
|
|
855
|
-
end
|
|
856
|
-
|
|
857
|
-
def name
|
|
858
|
-
')'
|
|
859
|
-
end
|
|
860
|
-
|
|
861
|
-
alias inspect name
|
|
862
|
-
|
|
863
|
-
attr_reader :lineno
|
|
864
|
-
end
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
class Prec
|
|
868
|
-
def initialize(symbol, lineno)
|
|
869
|
-
@symbol = symbol
|
|
870
|
-
@lineno = lineno
|
|
871
|
-
end
|
|
872
|
-
|
|
873
|
-
def name
|
|
874
|
-
"=#{@symbol}"
|
|
875
|
-
end
|
|
876
|
-
|
|
877
|
-
alias inspect name
|
|
878
|
-
|
|
879
|
-
attr_reader :symbol
|
|
880
|
-
attr_reader :lineno
|
|
881
|
-
end
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
#
|
|
885
|
-
# A set of rule and position in it's RHS.
|
|
886
|
-
# Note that the number of pointers is more than rule's RHS array,
|
|
887
|
-
# because pointer points right edge of the final symbol when reducing.
|
|
888
|
-
#
|
|
889
|
-
class LocationPointer
|
|
890
|
-
|
|
891
|
-
def initialize(rule, i, sym)
|
|
892
|
-
@rule = rule
|
|
893
|
-
@index = i
|
|
894
|
-
@symbol = sym
|
|
895
|
-
@ident = @rule.hash + i
|
|
896
|
-
@reduce = sym.nil?
|
|
897
|
-
end
|
|
898
|
-
|
|
899
|
-
attr_reader :rule
|
|
900
|
-
attr_reader :index
|
|
901
|
-
attr_reader :symbol
|
|
902
|
-
|
|
903
|
-
alias dereference symbol
|
|
904
|
-
|
|
905
|
-
attr_reader :ident
|
|
906
|
-
alias hash ident
|
|
907
|
-
attr_reader :reduce
|
|
908
|
-
alias reduce? reduce
|
|
909
|
-
|
|
910
|
-
def to_s
|
|
911
|
-
sprintf('(%d,%d %s)',
|
|
912
|
-
@rule.ident, @index, (reduce?() ? '#' : @symbol.to_s))
|
|
913
|
-
end
|
|
914
|
-
|
|
915
|
-
alias inspect to_s
|
|
916
|
-
|
|
917
|
-
def eql?(ot)
|
|
918
|
-
@hash == ot.hash
|
|
919
|
-
end
|
|
920
|
-
|
|
921
|
-
alias == eql?
|
|
922
|
-
|
|
923
|
-
def head?
|
|
924
|
-
@index == 0
|
|
925
|
-
end
|
|
926
|
-
|
|
927
|
-
def next
|
|
928
|
-
@rule.ptrs[@index + 1] or ptr_bug!
|
|
929
|
-
end
|
|
930
|
-
|
|
931
|
-
alias increment next
|
|
932
|
-
|
|
933
|
-
def before(len)
|
|
934
|
-
@rule.ptrs[@index - len] or ptr_bug!
|
|
935
|
-
end
|
|
936
|
-
|
|
937
|
-
private
|
|
938
|
-
|
|
939
|
-
def ptr_bug!
|
|
940
|
-
raise "racc: fatal: pointer not exist: self: #{to_s}"
|
|
941
|
-
end
|
|
942
|
-
|
|
943
|
-
end # class LocationPointer
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
class SymbolTable
|
|
947
|
-
|
|
948
|
-
include Enumerable
|
|
949
|
-
|
|
950
|
-
def initialize
|
|
951
|
-
@symbols = [] # :: [Racc::Sym]
|
|
952
|
-
@cache = {} # :: {(String|Symbol) => Racc::Sym}
|
|
953
|
-
@dummy = intern(:$start, true)
|
|
954
|
-
@anchor = intern(false, true) # Symbol ID = 0
|
|
955
|
-
@error = intern(:error, false) # Symbol ID = 1
|
|
956
|
-
end
|
|
957
|
-
|
|
958
|
-
attr_reader :dummy
|
|
959
|
-
attr_reader :anchor
|
|
960
|
-
attr_reader :error
|
|
961
|
-
|
|
962
|
-
def [](id)
|
|
963
|
-
@symbols[id]
|
|
964
|
-
end
|
|
965
|
-
|
|
966
|
-
def intern(val, dummy = false)
|
|
967
|
-
@cache[val] ||=
|
|
968
|
-
begin
|
|
969
|
-
sym = Sym.new(val, dummy)
|
|
970
|
-
@symbols.push sym
|
|
971
|
-
sym
|
|
972
|
-
end
|
|
973
|
-
end
|
|
974
|
-
|
|
975
|
-
attr_reader :symbols
|
|
976
|
-
alias to_a symbols
|
|
977
|
-
|
|
978
|
-
def delete(sym)
|
|
979
|
-
@symbols.delete sym
|
|
980
|
-
@cache.delete sym.value
|
|
981
|
-
end
|
|
982
|
-
|
|
983
|
-
attr_reader :nt_base
|
|
984
|
-
|
|
985
|
-
def nt_max
|
|
986
|
-
@symbols.size
|
|
987
|
-
end
|
|
988
|
-
|
|
989
|
-
def each(&block)
|
|
990
|
-
@symbols.each(&block)
|
|
991
|
-
end
|
|
992
|
-
|
|
993
|
-
def terminals(&block)
|
|
994
|
-
@symbols[0, @nt_base]
|
|
995
|
-
end
|
|
996
|
-
|
|
997
|
-
def each_terminal(&block)
|
|
998
|
-
@terms.each(&block)
|
|
999
|
-
end
|
|
1000
|
-
|
|
1001
|
-
def nonterminals
|
|
1002
|
-
@symbols[@nt_base, @symbols.size - @nt_base]
|
|
1003
|
-
end
|
|
1004
|
-
|
|
1005
|
-
def each_nonterminal(&block)
|
|
1006
|
-
@nterms.each(&block)
|
|
1007
|
-
end
|
|
1008
|
-
|
|
1009
|
-
def fix
|
|
1010
|
-
terms, nterms = @symbols.partition {|s| s.terminal? }
|
|
1011
|
-
@symbols = terms + nterms
|
|
1012
|
-
@terms = terms
|
|
1013
|
-
@nterms = nterms
|
|
1014
|
-
@nt_base = terms.size
|
|
1015
|
-
fix_ident
|
|
1016
|
-
check_terminals
|
|
1017
|
-
end
|
|
1018
|
-
|
|
1019
|
-
private
|
|
1020
|
-
|
|
1021
|
-
def fix_ident
|
|
1022
|
-
@symbols.each_with_index do |t, i|
|
|
1023
|
-
t.ident = i
|
|
1024
|
-
end
|
|
1025
|
-
end
|
|
1026
|
-
|
|
1027
|
-
def check_terminals
|
|
1028
|
-
return unless @symbols.any? {|s| s.should_terminal? }
|
|
1029
|
-
@anchor.should_terminal
|
|
1030
|
-
@error.should_terminal
|
|
1031
|
-
each_terminal do |t|
|
|
1032
|
-
t.should_terminal if t.string_symbol?
|
|
1033
|
-
end
|
|
1034
|
-
each do |s|
|
|
1035
|
-
s.should_terminal if s.assoc
|
|
1036
|
-
end
|
|
1037
|
-
terminals().reject {|t| t.should_terminal? }.each do |t|
|
|
1038
|
-
raise CompileError, "terminal #{t} not declared as terminal"
|
|
1039
|
-
end
|
|
1040
|
-
nonterminals().select {|n| n.should_terminal? }.each do |n|
|
|
1041
|
-
raise CompileError, "symbol #{n} declared as terminal but is not terminal"
|
|
1042
|
-
end
|
|
1043
|
-
end
|
|
1044
|
-
|
|
1045
|
-
end # class SymbolTable
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
# Stands terminal and nonterminal symbols.
|
|
1049
|
-
class Sym
|
|
1050
|
-
|
|
1051
|
-
def initialize(value, dummyp)
|
|
1052
|
-
@ident = nil
|
|
1053
|
-
@value = value
|
|
1054
|
-
@dummyp = dummyp
|
|
1055
|
-
|
|
1056
|
-
@term = nil
|
|
1057
|
-
@nterm = nil
|
|
1058
|
-
@should_terminal = false
|
|
1059
|
-
@precedence = nil
|
|
1060
|
-
case value
|
|
1061
|
-
when Symbol
|
|
1062
|
-
@to_s = value.to_s
|
|
1063
|
-
@serialized = value.inspect
|
|
1064
|
-
@string = false
|
|
1065
|
-
when String
|
|
1066
|
-
@to_s = value.inspect
|
|
1067
|
-
@serialized = value.dump
|
|
1068
|
-
@string = true
|
|
1069
|
-
when false
|
|
1070
|
-
@to_s = '$end'
|
|
1071
|
-
@serialized = 'false'
|
|
1072
|
-
@string = false
|
|
1073
|
-
else
|
|
1074
|
-
raise ArgumentError, "unknown symbol value: #{value.class}"
|
|
1075
|
-
end
|
|
1076
|
-
|
|
1077
|
-
@heads = []
|
|
1078
|
-
@locate = []
|
|
1079
|
-
@snull = nil
|
|
1080
|
-
@null = nil
|
|
1081
|
-
@expand = nil
|
|
1082
|
-
@useless = nil
|
|
1083
|
-
end
|
|
1084
|
-
|
|
1085
|
-
class << self
|
|
1086
|
-
def once_writer(nm)
|
|
1087
|
-
nm = nm.id2name
|
|
1088
|
-
module_eval(<<-EOS)
|
|
1089
|
-
def #{nm}=(v)
|
|
1090
|
-
raise 'racc: fatal: @#{nm} != nil' unless @#{nm}.nil?
|
|
1091
|
-
@#{nm} = v
|
|
1092
|
-
end
|
|
1093
|
-
EOS
|
|
1094
|
-
end
|
|
1095
|
-
end
|
|
1096
|
-
|
|
1097
|
-
once_writer :ident
|
|
1098
|
-
attr_reader :ident
|
|
1099
|
-
|
|
1100
|
-
alias hash ident
|
|
1101
|
-
|
|
1102
|
-
attr_reader :value
|
|
1103
|
-
|
|
1104
|
-
def dummy?
|
|
1105
|
-
@dummyp
|
|
1106
|
-
end
|
|
1107
|
-
|
|
1108
|
-
def terminal?
|
|
1109
|
-
@term
|
|
1110
|
-
end
|
|
1111
|
-
|
|
1112
|
-
def nonterminal?
|
|
1113
|
-
@nterm
|
|
1114
|
-
end
|
|
1115
|
-
|
|
1116
|
-
def term=(t)
|
|
1117
|
-
raise 'racc: fatal: term= called twice' unless @term.nil?
|
|
1118
|
-
@term = t
|
|
1119
|
-
@nterm = !t
|
|
1120
|
-
end
|
|
1121
|
-
|
|
1122
|
-
def should_terminal
|
|
1123
|
-
@should_terminal = true
|
|
1124
|
-
end
|
|
1125
|
-
|
|
1126
|
-
def should_terminal?
|
|
1127
|
-
@should_terminal
|
|
1128
|
-
end
|
|
1129
|
-
|
|
1130
|
-
def string_symbol?
|
|
1131
|
-
@string
|
|
1132
|
-
end
|
|
1133
|
-
|
|
1134
|
-
def serialize
|
|
1135
|
-
@serialized
|
|
1136
|
-
end
|
|
1137
|
-
|
|
1138
|
-
attr_writer :serialized
|
|
1139
|
-
|
|
1140
|
-
attr_accessor :precedence
|
|
1141
|
-
attr_accessor :assoc
|
|
1142
|
-
|
|
1143
|
-
def to_s
|
|
1144
|
-
@to_s.dup
|
|
1145
|
-
end
|
|
1146
|
-
|
|
1147
|
-
alias inspect to_s
|
|
1148
|
-
|
|
1149
|
-
def |(x)
|
|
1150
|
-
rule() | x.rule
|
|
1151
|
-
end
|
|
1152
|
-
|
|
1153
|
-
def rule
|
|
1154
|
-
Rule.new(nil, [self], UserAction.empty)
|
|
1155
|
-
end
|
|
1156
|
-
|
|
1157
|
-
#
|
|
1158
|
-
# cache
|
|
1159
|
-
#
|
|
1160
|
-
|
|
1161
|
-
attr_reader :heads
|
|
1162
|
-
attr_reader :locate
|
|
1163
|
-
|
|
1164
|
-
def self_null?
|
|
1165
|
-
@snull
|
|
1166
|
-
end
|
|
1167
|
-
|
|
1168
|
-
once_writer :snull
|
|
1169
|
-
|
|
1170
|
-
def nullable?
|
|
1171
|
-
@null
|
|
1172
|
-
end
|
|
1173
|
-
|
|
1174
|
-
def null=(n)
|
|
1175
|
-
@null = n
|
|
1176
|
-
end
|
|
1177
|
-
|
|
1178
|
-
attr_reader :expand
|
|
1179
|
-
once_writer :expand
|
|
1180
|
-
|
|
1181
|
-
def useless?
|
|
1182
|
-
@useless
|
|
1183
|
-
end
|
|
1184
|
-
|
|
1185
|
-
def useless=(f)
|
|
1186
|
-
@useless = f
|
|
1187
|
-
end
|
|
1188
|
-
|
|
1189
|
-
end # class Sym
|
|
1190
|
-
|
|
1191
|
-
end # module Racc
|