Skip to content

Commit

Permalink
Merge pull request #85 from chisholm/antlr4.9
Browse files Browse the repository at this point in the history
Regenerate parser with ANTLR 4.9.2
  • Loading branch information
clenk authored May 20, 2021
2 parents e926d0a + ec9c4cb commit 52de2bc
Show file tree
Hide file tree
Showing 10 changed files with 1,635 additions and 1,588 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ repos:
hooks:
- id: isort
name: Sort python imports (shows diff)
exclude: grammars
args: ["-c", "--diff"]
- id: isort
name: Sort python imports (fixes files)
exclude: grammars
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@
author_email='[email protected]',
maintainer='Chris Lenk',
maintainer_email='[email protected]',
python_requires=">=3.6",
packages=find_packages(),
install_requires=[
'antlr4-python3-runtime~=4.8.0 ; python_version>="3"',
'antlr4-python3-runtime~=4.9.0',
'six',
],
package_data={
Expand Down
535 changes: 265 additions & 270 deletions stix2patterns/v20/grammars/STIXPatternLexer.py

Large diffs are not rendered by default.

133 changes: 69 additions & 64 deletions stix2patterns/v20/grammars/STIXPatternListener.py
Original file line number Diff line number Diff line change
@@ -1,286 +1,291 @@
# Generated from STIXPattern.g4 by ANTLR 4.8
# Generated from STIXPattern.g4 by ANTLR 4.9.2
from antlr4 import *

if __name__ is not None and "." in __name__:
from .STIXPatternParser import STIXPatternParser
else:
from STIXPatternParser import STIXPatternParser

# This class defines a complete listener for a parse tree produced by STIXPatternParser.
class STIXPatternListener(ParseTreeListener):

# Enter a parse tree produced by STIXPatternParser#pattern.
def enterPattern(self, ctx):
def enterPattern(self, ctx:STIXPatternParser.PatternContext):
pass

# Exit a parse tree produced by STIXPatternParser#pattern.
def exitPattern(self, ctx):
def exitPattern(self, ctx:STIXPatternParser.PatternContext):
pass


# Enter a parse tree produced by STIXPatternParser#observationExpressions.
def enterObservationExpressions(self, ctx):
def enterObservationExpressions(self, ctx:STIXPatternParser.ObservationExpressionsContext):
pass

# Exit a parse tree produced by STIXPatternParser#observationExpressions.
def exitObservationExpressions(self, ctx):
def exitObservationExpressions(self, ctx:STIXPatternParser.ObservationExpressionsContext):
pass


# Enter a parse tree produced by STIXPatternParser#observationExpressionOr.
def enterObservationExpressionOr(self, ctx):
def enterObservationExpressionOr(self, ctx:STIXPatternParser.ObservationExpressionOrContext):
pass

# Exit a parse tree produced by STIXPatternParser#observationExpressionOr.
def exitObservationExpressionOr(self, ctx):
def exitObservationExpressionOr(self, ctx:STIXPatternParser.ObservationExpressionOrContext):
pass


# Enter a parse tree produced by STIXPatternParser#observationExpressionAnd.
def enterObservationExpressionAnd(self, ctx):
def enterObservationExpressionAnd(self, ctx:STIXPatternParser.ObservationExpressionAndContext):
pass

# Exit a parse tree produced by STIXPatternParser#observationExpressionAnd.
def exitObservationExpressionAnd(self, ctx):
def exitObservationExpressionAnd(self, ctx:STIXPatternParser.ObservationExpressionAndContext):
pass


# Enter a parse tree produced by STIXPatternParser#observationExpressionRepeated.
def enterObservationExpressionRepeated(self, ctx):
def enterObservationExpressionRepeated(self, ctx:STIXPatternParser.ObservationExpressionRepeatedContext):
pass

# Exit a parse tree produced by STIXPatternParser#observationExpressionRepeated.
def exitObservationExpressionRepeated(self, ctx):
def exitObservationExpressionRepeated(self, ctx:STIXPatternParser.ObservationExpressionRepeatedContext):
pass


# Enter a parse tree produced by STIXPatternParser#observationExpressionSimple.
def enterObservationExpressionSimple(self, ctx):
def enterObservationExpressionSimple(self, ctx:STIXPatternParser.ObservationExpressionSimpleContext):
pass

# Exit a parse tree produced by STIXPatternParser#observationExpressionSimple.
def exitObservationExpressionSimple(self, ctx):
def exitObservationExpressionSimple(self, ctx:STIXPatternParser.ObservationExpressionSimpleContext):
pass


# Enter a parse tree produced by STIXPatternParser#observationExpressionCompound.
def enterObservationExpressionCompound(self, ctx):
def enterObservationExpressionCompound(self, ctx:STIXPatternParser.ObservationExpressionCompoundContext):
pass

# Exit a parse tree produced by STIXPatternParser#observationExpressionCompound.
def exitObservationExpressionCompound(self, ctx):
def exitObservationExpressionCompound(self, ctx:STIXPatternParser.ObservationExpressionCompoundContext):
pass


# Enter a parse tree produced by STIXPatternParser#observationExpressionWithin.
def enterObservationExpressionWithin(self, ctx):
def enterObservationExpressionWithin(self, ctx:STIXPatternParser.ObservationExpressionWithinContext):
pass

# Exit a parse tree produced by STIXPatternParser#observationExpressionWithin.
def exitObservationExpressionWithin(self, ctx):
def exitObservationExpressionWithin(self, ctx:STIXPatternParser.ObservationExpressionWithinContext):
pass


# Enter a parse tree produced by STIXPatternParser#observationExpressionStartStop.
def enterObservationExpressionStartStop(self, ctx):
def enterObservationExpressionStartStop(self, ctx:STIXPatternParser.ObservationExpressionStartStopContext):
pass

# Exit a parse tree produced by STIXPatternParser#observationExpressionStartStop.
def exitObservationExpressionStartStop(self, ctx):
def exitObservationExpressionStartStop(self, ctx:STIXPatternParser.ObservationExpressionStartStopContext):
pass


# Enter a parse tree produced by STIXPatternParser#comparisonExpression.
def enterComparisonExpression(self, ctx):
def enterComparisonExpression(self, ctx:STIXPatternParser.ComparisonExpressionContext):
pass

# Exit a parse tree produced by STIXPatternParser#comparisonExpression.
def exitComparisonExpression(self, ctx):
def exitComparisonExpression(self, ctx:STIXPatternParser.ComparisonExpressionContext):
pass


# Enter a parse tree produced by STIXPatternParser#comparisonExpressionAnd.
def enterComparisonExpressionAnd(self, ctx):
def enterComparisonExpressionAnd(self, ctx:STIXPatternParser.ComparisonExpressionAndContext):
pass

# Exit a parse tree produced by STIXPatternParser#comparisonExpressionAnd.
def exitComparisonExpressionAnd(self, ctx):
def exitComparisonExpressionAnd(self, ctx:STIXPatternParser.ComparisonExpressionAndContext):
pass


# Enter a parse tree produced by STIXPatternParser#propTestEqual.
def enterPropTestEqual(self, ctx):
def enterPropTestEqual(self, ctx:STIXPatternParser.PropTestEqualContext):
pass

# Exit a parse tree produced by STIXPatternParser#propTestEqual.
def exitPropTestEqual(self, ctx):
def exitPropTestEqual(self, ctx:STIXPatternParser.PropTestEqualContext):
pass


# Enter a parse tree produced by STIXPatternParser#propTestOrder.
def enterPropTestOrder(self, ctx):
def enterPropTestOrder(self, ctx:STIXPatternParser.PropTestOrderContext):
pass

# Exit a parse tree produced by STIXPatternParser#propTestOrder.
def exitPropTestOrder(self, ctx):
def exitPropTestOrder(self, ctx:STIXPatternParser.PropTestOrderContext):
pass


# Enter a parse tree produced by STIXPatternParser#propTestSet.
def enterPropTestSet(self, ctx):
def enterPropTestSet(self, ctx:STIXPatternParser.PropTestSetContext):
pass

# Exit a parse tree produced by STIXPatternParser#propTestSet.
def exitPropTestSet(self, ctx):
def exitPropTestSet(self, ctx:STIXPatternParser.PropTestSetContext):
pass


# Enter a parse tree produced by STIXPatternParser#propTestLike.
def enterPropTestLike(self, ctx):
def enterPropTestLike(self, ctx:STIXPatternParser.PropTestLikeContext):
pass

# Exit a parse tree produced by STIXPatternParser#propTestLike.
def exitPropTestLike(self, ctx):
def exitPropTestLike(self, ctx:STIXPatternParser.PropTestLikeContext):
pass


# Enter a parse tree produced by STIXPatternParser#propTestRegex.
def enterPropTestRegex(self, ctx):
def enterPropTestRegex(self, ctx:STIXPatternParser.PropTestRegexContext):
pass

# Exit a parse tree produced by STIXPatternParser#propTestRegex.
def exitPropTestRegex(self, ctx):
def exitPropTestRegex(self, ctx:STIXPatternParser.PropTestRegexContext):
pass


# Enter a parse tree produced by STIXPatternParser#propTestIsSubset.
def enterPropTestIsSubset(self, ctx):
def enterPropTestIsSubset(self, ctx:STIXPatternParser.PropTestIsSubsetContext):
pass

# Exit a parse tree produced by STIXPatternParser#propTestIsSubset.
def exitPropTestIsSubset(self, ctx):
def exitPropTestIsSubset(self, ctx:STIXPatternParser.PropTestIsSubsetContext):
pass


# Enter a parse tree produced by STIXPatternParser#propTestIsSuperset.
def enterPropTestIsSuperset(self, ctx):
def enterPropTestIsSuperset(self, ctx:STIXPatternParser.PropTestIsSupersetContext):
pass

# Exit a parse tree produced by STIXPatternParser#propTestIsSuperset.
def exitPropTestIsSuperset(self, ctx):
def exitPropTestIsSuperset(self, ctx:STIXPatternParser.PropTestIsSupersetContext):
pass


# Enter a parse tree produced by STIXPatternParser#propTestParen.
def enterPropTestParen(self, ctx):
def enterPropTestParen(self, ctx:STIXPatternParser.PropTestParenContext):
pass

# Exit a parse tree produced by STIXPatternParser#propTestParen.
def exitPropTestParen(self, ctx):
def exitPropTestParen(self, ctx:STIXPatternParser.PropTestParenContext):
pass


# Enter a parse tree produced by STIXPatternParser#startStopQualifier.
def enterStartStopQualifier(self, ctx):
def enterStartStopQualifier(self, ctx:STIXPatternParser.StartStopQualifierContext):
pass

# Exit a parse tree produced by STIXPatternParser#startStopQualifier.
def exitStartStopQualifier(self, ctx):
def exitStartStopQualifier(self, ctx:STIXPatternParser.StartStopQualifierContext):
pass


# Enter a parse tree produced by STIXPatternParser#withinQualifier.
def enterWithinQualifier(self, ctx):
def enterWithinQualifier(self, ctx:STIXPatternParser.WithinQualifierContext):
pass

# Exit a parse tree produced by STIXPatternParser#withinQualifier.
def exitWithinQualifier(self, ctx):
def exitWithinQualifier(self, ctx:STIXPatternParser.WithinQualifierContext):
pass


# Enter a parse tree produced by STIXPatternParser#repeatedQualifier.
def enterRepeatedQualifier(self, ctx):
def enterRepeatedQualifier(self, ctx:STIXPatternParser.RepeatedQualifierContext):
pass

# Exit a parse tree produced by STIXPatternParser#repeatedQualifier.
def exitRepeatedQualifier(self, ctx):
def exitRepeatedQualifier(self, ctx:STIXPatternParser.RepeatedQualifierContext):
pass


# Enter a parse tree produced by STIXPatternParser#objectPath.
def enterObjectPath(self, ctx):
def enterObjectPath(self, ctx:STIXPatternParser.ObjectPathContext):
pass

# Exit a parse tree produced by STIXPatternParser#objectPath.
def exitObjectPath(self, ctx):
def exitObjectPath(self, ctx:STIXPatternParser.ObjectPathContext):
pass


# Enter a parse tree produced by STIXPatternParser#objectType.
def enterObjectType(self, ctx):
def enterObjectType(self, ctx:STIXPatternParser.ObjectTypeContext):
pass

# Exit a parse tree produced by STIXPatternParser#objectType.
def exitObjectType(self, ctx):
def exitObjectType(self, ctx:STIXPatternParser.ObjectTypeContext):
pass


# Enter a parse tree produced by STIXPatternParser#firstPathComponent.
def enterFirstPathComponent(self, ctx):
def enterFirstPathComponent(self, ctx:STIXPatternParser.FirstPathComponentContext):
pass

# Exit a parse tree produced by STIXPatternParser#firstPathComponent.
def exitFirstPathComponent(self, ctx):
def exitFirstPathComponent(self, ctx:STIXPatternParser.FirstPathComponentContext):
pass


# Enter a parse tree produced by STIXPatternParser#indexPathStep.
def enterIndexPathStep(self, ctx):
def enterIndexPathStep(self, ctx:STIXPatternParser.IndexPathStepContext):
pass

# Exit a parse tree produced by STIXPatternParser#indexPathStep.
def exitIndexPathStep(self, ctx):
def exitIndexPathStep(self, ctx:STIXPatternParser.IndexPathStepContext):
pass


# Enter a parse tree produced by STIXPatternParser#pathStep.
def enterPathStep(self, ctx):
def enterPathStep(self, ctx:STIXPatternParser.PathStepContext):
pass

# Exit a parse tree produced by STIXPatternParser#pathStep.
def exitPathStep(self, ctx):
def exitPathStep(self, ctx:STIXPatternParser.PathStepContext):
pass


# Enter a parse tree produced by STIXPatternParser#keyPathStep.
def enterKeyPathStep(self, ctx):
def enterKeyPathStep(self, ctx:STIXPatternParser.KeyPathStepContext):
pass

# Exit a parse tree produced by STIXPatternParser#keyPathStep.
def exitKeyPathStep(self, ctx):
def exitKeyPathStep(self, ctx:STIXPatternParser.KeyPathStepContext):
pass


# Enter a parse tree produced by STIXPatternParser#setLiteral.
def enterSetLiteral(self, ctx):
def enterSetLiteral(self, ctx:STIXPatternParser.SetLiteralContext):
pass

# Exit a parse tree produced by STIXPatternParser#setLiteral.
def exitSetLiteral(self, ctx):
def exitSetLiteral(self, ctx:STIXPatternParser.SetLiteralContext):
pass


# Enter a parse tree produced by STIXPatternParser#primitiveLiteral.
def enterPrimitiveLiteral(self, ctx):
def enterPrimitiveLiteral(self, ctx:STIXPatternParser.PrimitiveLiteralContext):
pass

# Exit a parse tree produced by STIXPatternParser#primitiveLiteral.
def exitPrimitiveLiteral(self, ctx):
def exitPrimitiveLiteral(self, ctx:STIXPatternParser.PrimitiveLiteralContext):
pass


# Enter a parse tree produced by STIXPatternParser#orderableLiteral.
def enterOrderableLiteral(self, ctx):
def enterOrderableLiteral(self, ctx:STIXPatternParser.OrderableLiteralContext):
pass

# Exit a parse tree produced by STIXPatternParser#orderableLiteral.
def exitOrderableLiteral(self, ctx):
def exitOrderableLiteral(self, ctx:STIXPatternParser.OrderableLiteralContext):
pass



del STIXPatternParser
Loading

0 comments on commit 52de2bc

Please sign in to comment.