├── .gitignore ├── .gitmodules ├── README.md ├── requirements.txt ├── samples └── simple.sol ├── scripts └── antlr4.sh ├── setup.py └── solidity_parser ├── __init__.py ├── __main__.py ├── parser.py └── solidity_antlr4 ├── Solidity.interp ├── Solidity.tokens ├── SolidityLexer.interp ├── SolidityLexer.py ├── SolidityLexer.tokens ├── SolidityListener.py ├── SolidityParser.py ├── SolidityVisitor.py ├── __AUTOGENERATED__ └── __init__.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | 53 | # Translations 54 | *.mo 55 | *.pot 56 | 57 | # Django stuff: 58 | *.log 59 | local_settings.py 60 | db.sqlite3 61 | 62 | # Flask stuff: 63 | instance/ 64 | .webassets-cache 65 | 66 | # Scrapy stuff: 67 | .scrapy 68 | 69 | # Sphinx documentation 70 | docs/_build/ 71 | 72 | # PyBuilder 73 | target/ 74 | 75 | # Jupyter Notebook 76 | .ipynb_checkpoints 77 | 78 | # IPython 79 | profile_default/ 80 | ipython_config.py 81 | 82 | # pyenv 83 | .python-version 84 | 85 | # celery beat schedule file 86 | celerybeat-schedule 87 | 88 | # SageMath parsed files 89 | *.sage.py 90 | 91 | # Environments 92 | .env 93 | .venv 94 | env/ 95 | venv/ 96 | ENV/ 97 | env.bak/ 98 | venv.bak/ 99 | 100 | # Spyder project settings 101 | .spyderproject 102 | .spyproject 103 | 104 | # Rope project settings 105 | .ropeproject 106 | 107 | # mkdocs documentation 108 | /site 109 | 110 | # mypy 111 | .mypy_cache/ 112 | .dmypy.json 113 | dmypy.json 114 | 115 | # Pyre type checker 116 | .pyre/ 117 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "solidity-antlr4"] 2 | path = solidity-antlr4 3 | url = https://github.com/solidity-parser/antlr.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # python-solidity-parser 2 | An experimental Solidity parser for Python built on top of a robust ANTLR4 grammar. 3 | 4 | **ⓘ** This is a **python3** port of the [javascript antlr parser](https://github.com/federicobond/solidity-parser-antlr) maintained by [@federicobond](https://github.com/federicobond/). Interfaces are intentionally following the javascript implementation and are therefore not pep8 compliant. 5 | 6 | 7 | 8 | ## Install 9 | 10 | ``` 11 | #> pip3 install solidity_parser 12 | #> python3 -m solidity_parser # print parse tree or sourceUnit outline 13 | ``` 14 | 15 | ## HowTo 16 | 17 | ```python 18 | 19 | import sys 20 | import pprint 21 | 22 | from solidity_parser import parser 23 | 24 | sourceUnit = parser.parse_file(sys.argv[1], loc=False) # loc=True -> add location information to ast nodes 25 | pprint.pprint(sourceUnit) 26 | # see output below 27 | 28 | ``` 29 | 30 | output: 31 | ```` 32 | {'type': 'SourceUnit', 33 | 'children': [{'type': 'PragmaDirective', 34 | 'name': 'solidity', 35 | 'value': '^0.4.22'}, 36 | {'type': 'ContractDefinition'}, 37 | 'baseContracts': [], 38 | 'kind': 'contract', 39 | 'name': 'SimpleAuction', 40 | 'subNodes': [{'initialValue': None, 41 | 'type': 'StateVariableDeclaration', 42 | 'variables': [{'expression': None, 43 | 'isDeclaredConst': False, 44 | 'isIndexed': False, 45 | 'isStateVar': True, 46 | 'name': 'beneficiary', 47 | 'type': 'VariableDeclaration', 48 | 'typeName': {'name': 'address', 49 | 'type': 'ElementaryTypeName'}, 50 | 'visibility': 'public'}]}, 51 | ... 52 | ```` 53 | 54 | ### Nodes 55 | 56 | Parse-tree nodes can be accessed both like dictionaries or via object attributes. Nodes always carry a `type` field to hint the type of AST node. The start node is always of type `sourceUnit`. 57 | 58 | ## Accessing AST items in an Object Oriented fashion 59 | 60 | ```python 61 | # ... continuing from previous snippet 62 | 63 | # subparse into objects for nicer interfaces: 64 | # create a nested object structure from AST 65 | sourceUnitObject = parser.objectify(sourceUnit) 66 | 67 | # access imports, contracts, functions, ... (see outline example in __main__.py) 68 | sourceUnitObject.imports # [] 69 | sourceUnitObject.pragmas # [] 70 | sourceUnitObject.contracts.keys() # get all contract names 71 | sourceUnitObject.contracts["contractName"].functions.keys() # get all functions in contract: "contractName" 72 | sourceUnitObject.contracts["contractName"].functions["myFunction"].visibility # get "myFunction"s visibility (or stateMutability) 73 | ``` 74 | 75 | 76 | ## Generate the parser 77 | 78 | Update the grammar in `./solidity-antlr4/Solidity.g4` and run the antlr generator script to create the parser classes in `solidity_parser/solidity_antlr4`. 79 | ``` 80 | #> bash script/antlr4.sh 81 | ``` 82 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | antlr4-python3-runtime==4.9.3 -------------------------------------------------------------------------------- /samples/simple.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.22; 2 | pragma solidity 0.4.22; 3 | pragma experimental something; 4 | 5 | import "a.sol"; 6 | import {a,b} from "a.sol"; 7 | import "./abc.sol" as x; 8 | import * as y from "./abc.sol"; 9 | import {a as b, c as d, f} from "./abc.sol"; 10 | 11 | contract SimpleAuction { 12 | // Parameters of the auction. Times are either 13 | // absolute unix timestamps (seconds since 1970-01-01) 14 | // or time periods in seconds. 15 | address public beneficiary; 16 | uint public auctionEnd; 17 | 18 | 19 | // Current state of the auction. 20 | address public highestBidder; 21 | uint public highestBid; 22 | 23 | // Allowed withdrawals of previous bids 24 | mapping(address => uint) pendingReturns; 25 | 26 | // Set to true at the end, disallows any change 27 | bool ended; 28 | 29 | struct MyStructName { 30 | address addr; 31 | uint256 count; 32 | } 33 | 34 | 35 | MyStructName haha; 36 | 37 | enum SomeData {DEFAULT,ONE,TWO} 38 | SomeData someData; 39 | 40 | // Events that will be fired on changes. 41 | event HighestBidIncreased(address bidder, uint amount); 42 | event AuctionEnded(address winner, uint amount); 43 | 44 | // The following is a so-called natspec comment, 45 | // recognizable by the three slashes. 46 | // It will be shown when the user is asked to 47 | // confirm a transaction. 48 | 49 | /// Create a simple auction with `_biddingTime` 50 | /// seconds bidding time on behalf of the 51 | /// beneficiary address `_beneficiary`. 52 | constructor( 53 | uint _biddingTime, 54 | address _beneficiary 55 | ) public { 56 | beneficiary = payable(_beneficiary); 57 | auctionEnd = now + _biddingTime; 58 | } 59 | 60 | function(uint a, uint b) public {} 61 | 62 | function(SimpleAuction a) public {} 63 | 64 | /// Bid on the auction with the value sent 65 | /// together with this transaction. 66 | /// The value will only be refunded if the 67 | /// auction is not won. 68 | function bid() public payable { 69 | // No arguments are necessary, all 70 | // information is already part of 71 | // the transaction. The keyword payable 72 | // is required for the function to 73 | // be able to receive Ether. 74 | 75 | // Revert the call if the bidding 76 | // period is over. 77 | require( 78 | now <= auctionEnd, 79 | "Auction already ended." 80 | ); 81 | 82 | // If the bid is not higher, send the 83 | // money back. 84 | require( 85 | msg.value > highestBid, 86 | "There already is a higher bid." 87 | ); 88 | 89 | if (highestBid != 0) { 90 | // Sending back the money by simply using 91 | // highestBidder.send(highestBid) is a security risk 92 | // because it could execute an untrusted contract. 93 | // It is always safer to let the recipients 94 | // withdraw their money themselves. 95 | pendingReturns[highestBidder] += highestBid; 96 | } 97 | highestBidder = msg.sender; 98 | highestBid = msg.value; 99 | emit HighestBidIncreased(msg.sender, msg.value); 100 | } 101 | 102 | /// Withdraw a bid that was overbid. 103 | function withdraw() public returns (bool) { 104 | uint amount = pendingReturns[msg.sender]; 105 | if (amount > 0) { 106 | // It is important to set this to zero because the recipient 107 | // can call this function again as part of the receiving call 108 | // before `send` returns. 109 | pendingReturns[msg.sender] = 0; 110 | 111 | if (!msg.sender.send(amount)) { 112 | // No need to call throw here, just reset the amount owing 113 | pendingReturns[msg.sender] = amount; 114 | return false; 115 | } 116 | } 117 | return true; 118 | } 119 | 120 | modifier loli () { 121 | 122 | } 123 | 124 | function lol() public { 125 | return pendingReturns[msg.sender]; 126 | } 127 | 128 | /// End the auction and send the highest bid 129 | /// to the beneficiary. 130 | function auctionEnd() public { 131 | // It is a good guideline to structure functions that interact 132 | // with other contracts (i.e. they call functions or send Ether) 133 | // into three phases: 134 | // 1. checking conditions 135 | // 2. performing actions (potentially changing conditions) 136 | // 3. interacting with other contracts 137 | // If these phases are mixed up, the other contract could call 138 | // back into the current contract and modify the state or cause 139 | // effects (ether payout) to be performed multiple times. 140 | // If functions called internally include interaction with external 141 | // contracts, they also have to be considered interaction with 142 | // external contracts. 143 | 144 | // 1. Conditions 145 | require(now >= auctionEnd, "Auction not yet ended."); 146 | require(!ended, "auctionEnd has already been called."); 147 | 148 | // 2. Effects 149 | ended = true; 150 | emit AuctionEnded(highestBidder, highestBid); 151 | 152 | // 3. Interaction 153 | beneficiary.transfer(highestBid); 154 | } 155 | } -------------------------------------------------------------------------------- /scripts/antlr4.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -o errexit 4 | 5 | antlr -Dlanguage=Python3 solidity-antlr4/Solidity.g4 -o src -visitor 6 | 7 | mv src/solidity-antlr4/* solidity_parser/solidity_antlr4 8 | rm -rf src/solidity-antlr4 9 | 10 | touch solidity_parser/solidity_antlr4/__init__.py 11 | touch solidity_parser/solidity_antlr4/__AUTOGENERATED__ 12 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | ''' 5 | 6 | deps (requires up2date version): 7 | *) pip install --upgrade pip wheel setuptools twine 8 | publish to pypi w/o having to convert Readme.md to RST: 9 | 1) #> python setup.py sdist bdist_wheel 10 | 2) #> twine upload dist/* #; #optional --repository or --repository-url 11 | 12 | ''' 13 | import os 14 | from setuptools import setup, find_packages 15 | 16 | 17 | def read(fname): 18 | return open(os.path.join(os.path.dirname(__file__), fname)).read() 19 | 20 | 21 | version = "0.1.1" 22 | name = "solidity-parser" 23 | 24 | setup( 25 | name=name, 26 | version=version, 27 | packages=find_packages(), 28 | author="tintinweb", 29 | author_email="tintinweb@oststrom.com", 30 | description=( 31 | "A Solidity parser for Python built on top of a robust ANTLR4 grammar"), 32 | license="MIT", 33 | keywords=["solidity","parser","antlr"], 34 | url="https://github.com/consensys/python-%s/"%name, 35 | download_url="https://github.com/consensys/python-%s/tarball/v%s"%(name, version), 36 | long_description=read("README.md") if os.path.isfile("README.md") else "", 37 | long_description_content_type='text/markdown', 38 | #python setup.py register -r https://testpypi.python.org/pypi 39 | install_requires=["antlr4-python3-runtime==4.9.3"], 40 | #test_suite="nose.collector", 41 | #tests_require=["nose"], 42 | ) 43 | -------------------------------------------------------------------------------- /solidity_parser/__init__.py: -------------------------------------------------------------------------------- 1 | from .parser import parse_file, parse, objectify, visit 2 | 3 | __ALL__ = ["parse", "parse_file", "objectify", "visit"] 4 | -------------------------------------------------------------------------------- /solidity_parser/__main__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import sys 5 | import pprint 6 | from . import parser 7 | 8 | if __name__ == "__main__": 9 | if not len(sys.argv)>2 or sys.argv[1] not in ("parse","outline"): 10 | print("\n- missing subcommand or path to solidity file.\n") 11 | print("#> python -m solidity_parser ") 12 | print("") 13 | print("\t subcommands:") 14 | print("\t\t parse ... print the parsetree for the sourceUnit") 15 | print("\t\t outline ... print a high level outline of the sourceUnit") 16 | sys.exit(1) 17 | 18 | node = parser.parse_file(sys.argv[2], loc=False) 19 | if sys.argv[1]=="parse": 20 | pprint.pprint(node) 21 | elif sys.argv[1]=="outline": 22 | level = 0 23 | sourceUnitObject = parser.objectify(node) 24 | print("=== pragmas ===") 25 | level +=1 26 | for p in sourceUnitObject.pragmas: 27 | print(("\t" * level) + "* " + str(p)) 28 | level -=1 29 | print("=== imports ===") 30 | level +=1 31 | for p in sourceUnitObject.imports: 32 | print(("\t" * level) + "* " + str(p)) 33 | level = 0 34 | for contract_name, contract_object in sourceUnitObject.contracts.items(): 35 | print("=== contract: " + contract_name) 36 | level +=1 37 | 38 | print(("\t" * level) + "=== Inherited Contracts: " + ','.join([bc.baseName.namePath for bc in contract_object._node.baseContracts])) 39 | ## statevars 40 | print(("\t" * level) + "=== Enums") 41 | level += 2 42 | for name in contract_object.enums.keys(): 43 | print(("\t" * level) + "* " + str(name)) 44 | level -= 2 45 | ## structs 46 | print(("\t" * level) + "=== Structs") 47 | level += 2 48 | for name in contract_object.structs.keys(): 49 | print(("\t" * level) + "* " + str(name)) 50 | level -= 2 51 | ## statevars 52 | print(("\t" * level) + "=== statevars" ) 53 | level +=2 54 | for name in contract_object.stateVars.keys(): 55 | print(("\t" * level) + "* " + str(name) ) 56 | level -=2 57 | ## modifiers 58 | print(("\t" * level) + "=== modifiers") 59 | level += 2 60 | for name in contract_object.modifiers.keys(): 61 | print(("\t" * level) + "* " + str(name)) 62 | level -= 2 63 | ## functions 64 | print(("\t" * level) + "=== functions") 65 | level += 2 66 | for name, funcObj in contract_object.functions.items(): 67 | txtAttribs = [] 68 | if funcObj.visibility: 69 | txtAttribs.append(funcObj.visibility) 70 | if funcObj.stateMutability: 71 | txtAttribs.append(funcObj.stateMutability) 72 | print(("\t" * level) + "* " + str(name) + "\t\t (" + ','.join(txtAttribs)+ ")") 73 | level -= 2 74 | 75 | -------------------------------------------------------------------------------- /solidity_parser/parser.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # part of https://github.com/ConsenSys/python-solidity-parser 5 | # derived from https://github.com/federicobond/solidity-parser-antlr/ 6 | # 7 | 8 | 9 | from antlr4 import * 10 | from solidity_parser.solidity_antlr4.SolidityLexer import SolidityLexer 11 | from solidity_parser.solidity_antlr4.SolidityParser import SolidityParser 12 | from solidity_parser.solidity_antlr4.SolidityVisitor import SolidityVisitor 13 | 14 | 15 | class Node(dict): 16 | """ 17 | provide a dict interface and object attrib access 18 | """ 19 | ENABLE_LOC = False 20 | NONCHILD_KEYS = ("type","name","loc") 21 | 22 | def __init__(self, ctx, **kwargs): 23 | for k, v in kwargs.items(): 24 | self[k] = v 25 | 26 | if Node.ENABLE_LOC: 27 | self["loc"] = Node._get_loc(ctx) 28 | 29 | def __getattr__(self, item): 30 | return self[item] # raise exception if attribute does not exist 31 | 32 | def __setattr__(self, name, value): 33 | self[name] = value 34 | 35 | @staticmethod 36 | def _get_loc(ctx): 37 | return { 38 | 'start': { 39 | 'line': ctx.start.line, 40 | 'column': ctx.start.column 41 | }, 42 | 'end': { 43 | 'line': ctx.stop.line, 44 | 'column': ctx.stop.column 45 | } 46 | } 47 | 48 | 49 | class AstVisitor(SolidityVisitor): 50 | 51 | def _mapCommasToNulls(self, children): 52 | if not children or len(children) == 0: 53 | return [] 54 | 55 | values = [] 56 | comma = True 57 | 58 | for el in children: 59 | if comma: 60 | if el.getText() == ',': 61 | values.append(None) 62 | else: 63 | values.append(el) 64 | comma = False 65 | else: 66 | if el.getText() != ',': 67 | raise Exception('expected comma') 68 | 69 | comma = True 70 | 71 | if comma: 72 | values.append(None) 73 | 74 | return values 75 | 76 | def _createNode(self, **kwargs): 77 | ## todo: add loc! 78 | return Node(**kwargs) 79 | 80 | def visit(self, tree): 81 | """ 82 | override the default visit to optionally accept a range of children nodes 83 | 84 | :param tree: 85 | :return: 86 | """ 87 | if tree is None: 88 | return None 89 | elif isinstance(tree, list): 90 | return self._visit_nodes(tree) 91 | else: 92 | return super().visit(tree) 93 | 94 | def _visit_nodes(self, nodes): 95 | """ 96 | modified version of visitChildren() that returns an array of results 97 | 98 | :param nodes: 99 | :return: 100 | """ 101 | allresults = [] 102 | result = self.defaultResult() 103 | for c in nodes: 104 | childResult = c.accept(self) 105 | result = self.aggregateResult(result, childResult) 106 | allresults.append(result) 107 | return allresults 108 | 109 | # ******************************************************** 110 | 111 | def visitSourceUnit(self, ctx): 112 | return Node(ctx=ctx, 113 | type="SourceUnit", 114 | children=self.visit(ctx.children[:-1])) # skip EOF 115 | 116 | def visitEnumDefinition(self, ctx): 117 | return Node(ctx=ctx, 118 | type="EnumDefinition", 119 | name=ctx.identifier().getText(), 120 | members=self.visit(ctx.enumValue())) 121 | 122 | def visitEnumValue(self, ctx): 123 | return Node(ctx=ctx, 124 | type="EnumValue", 125 | name=ctx.identifier().getText()) 126 | 127 | def visitTypeDefinition(self, ctx): 128 | return Node(ctx=ctx, 129 | type="TypeDefinition", 130 | typeKeyword=ctx.TypeKeyword().getText(), 131 | elementaryTypeName=self.visit(ctx.elementaryTypeName())) 132 | 133 | 134 | def visitCustomErrorDefinition(self, ctx): 135 | return Node(ctx=ctx, 136 | type="CustomErrorDefinition", 137 | name=self.visit(ctx.identifier()), 138 | parameterList=self.visit(ctx.parameterList())) 139 | 140 | def visitFileLevelConstant(self, ctx): 141 | return Node(ctx=ctx, 142 | type="FileLevelConstant", 143 | name=self.visit(ctx.identifier()), 144 | typeName=self.visit(ctx.typeName()), 145 | ConstantKeyword=self.visit(ctx.ConstantKeyword())) 146 | 147 | 148 | def visitUsingForDeclaration(self, ctx: SolidityParser.UsingForDeclarationContext): 149 | typename = None 150 | if ctx.getChild(3) != '*': 151 | typename = self.visit(ctx.getChild(3)) 152 | 153 | return Node(ctx=ctx, 154 | type="UsingForDeclaration", 155 | typeName=typename, 156 | libraryName=ctx.identifier().getText()) 157 | 158 | def visitInheritanceSpecifier(self, ctx: SolidityParser.InheritanceSpecifierContext): 159 | return Node(ctx=ctx, 160 | type="InheritanceSpecifier", 161 | baseName=self.visit(ctx.userDefinedTypeName()), 162 | arguments=self.visit(ctx.expressionList())) 163 | 164 | def visitContractPart(self, ctx: SolidityParser.ContractPartContext): 165 | return self.visit(ctx.children[0]) 166 | 167 | 168 | def visitFunctionDefinition(self, ctx: SolidityParser.FunctionDefinitionContext): 169 | isConstructor = isFallback =isReceive = False 170 | 171 | fd = ctx.functionDescriptor() 172 | if fd.ConstructorKeyword(): 173 | name = fd.ConstructorKeyword().getText() 174 | isConstructor = True 175 | elif fd.FallbackKeyword(): 176 | name = fd.FallbackKeyword().getText() 177 | isFallback = True 178 | elif fd.ReceiveKeyword(): 179 | name = fd.ReceiveKeyword().getText() 180 | isReceive = True 181 | elif fd.identifier(): 182 | name = fd.identifier().getText() 183 | else: 184 | name = ctx.getText() 185 | 186 | parameters = self.visit(ctx.parameterList()) 187 | returnParameters = self.visit(ctx.returnParameters()) if ctx.returnParameters() else [] 188 | block = self.visit(ctx.block()) if ctx.block() else [] 189 | modifiers = [self.visit(i) for i in ctx.modifierList().modifierInvocation()] 190 | 191 | if ctx.modifierList().ExternalKeyword(0): 192 | visibility = "external" 193 | elif ctx.modifierList().InternalKeyword(0): 194 | visibility = "internal" 195 | elif ctx.modifierList().PublicKeyword(0): 196 | visibility = "public" 197 | elif ctx.modifierList().PrivateKeyword(0): 198 | visibility = "private" 199 | else: 200 | visibility = 'default' 201 | 202 | if ctx.modifierList().stateMutability(0): 203 | stateMutability = ctx.modifierList().stateMutability(0).getText() 204 | else: 205 | stateMutability = None 206 | 207 | return Node(ctx=ctx, 208 | type="FunctionDefinition", 209 | name=name, 210 | parameters=parameters, 211 | returnParameters=returnParameters, 212 | body=block, 213 | visibility=visibility, 214 | modifiers=modifiers, 215 | isConstructor=isConstructor, 216 | isFallback=isFallback, 217 | isReceive=isReceive, 218 | stateMutability=stateMutability) 219 | 220 | def visitReturnParameters(self, ctx: SolidityParser.ReturnParametersContext): 221 | return self.visit(ctx.parameterList()) 222 | 223 | def visitParameterList(self, ctx: SolidityParser.ParameterListContext): 224 | parameters = [self.visit(p) for p in ctx.parameter()] 225 | return Node(ctx=ctx, 226 | type="ParameterList", 227 | parameters=parameters) 228 | 229 | def visitParameter(self, ctx: SolidityParser.ParameterContext): 230 | 231 | storageLocation = ctx.storageLocation().getText() if ctx.storageLocation() else None 232 | name = ctx.identifier().getText() if ctx.identifier() else None 233 | 234 | return Node(ctx=ctx, 235 | type="Parameter", 236 | typeName=self.visit(ctx.typeName()), 237 | name=name, 238 | storageLocation=storageLocation, 239 | isStateVar=False, 240 | isIndexed=False 241 | ) 242 | 243 | def visitModifierInvocation(self, ctx): 244 | exprList = ctx.expressionList() 245 | 246 | if exprList is not None: 247 | args = self.visit(exprList.expression()) 248 | else: 249 | args = [] 250 | 251 | return Node(ctx=ctx, 252 | type='ModifierInvocation', 253 | name=ctx.identifier().getText(), 254 | arguments=args) 255 | 256 | def visitElementaryTypeNameExpression(self, ctx): 257 | return Node(ctx=ctx, 258 | type='ElementaryTypeNameExpression', 259 | typeName=self.visit(ctx.elementaryTypeName())) 260 | 261 | def visitTypeName(self, ctx): 262 | if len(ctx.children) > 2: 263 | length = None 264 | if len(ctx.children) == 4: 265 | length = self.visit(ctx.getChild(2)) 266 | 267 | return Node(ctx=ctx, 268 | type='ArrayTypeName', 269 | baseTypeName=self.visit(ctx.getChild(0)), 270 | length=length) 271 | 272 | if len(ctx.children) == 2: 273 | return Node(ctx=ctx, 274 | type='ElementaryTypeName', 275 | name=ctx.getChild(0).getText(), 276 | stateMutability=ctx.getChild(1).getText()) 277 | 278 | return self.visit(ctx.getChild(0)) 279 | 280 | def visitFunctionTypeName(self, ctx): 281 | parameterTypes = [self.visit(p) for p in ctx.functionTypeParameterList(0).functionTypeParameter()] 282 | returnTypes = [] 283 | 284 | if ctx.functionTypeParameterList(1): 285 | returnTypes = [self.visit(p) for p in ctx.functionTypeParameterList(1).functionTypeParameter()] 286 | 287 | visibility = 'default' 288 | if ctx.InternalKeyword(0): 289 | visibility = 'internal' 290 | elif ctx.ExternalKeyword(0): 291 | visibility = 'external' 292 | 293 | stateMutability = None 294 | if ctx.stateMutability(0): 295 | stateMutability = ctx.stateMutability(0).getText() 296 | 297 | return Node(ctx=ctx, 298 | type='FunctionTypeName', 299 | parameterTypes=parameterTypes, 300 | returnTypes=returnTypes, 301 | visibility=visibility, 302 | stateMutability=stateMutability) 303 | 304 | def visitFunctionCall(self, ctx): 305 | args = [] 306 | names = [] 307 | 308 | ctxArgs = ctx.functionCallArguments() 309 | 310 | if ctxArgs.expressionList(): 311 | args = [self.visit(a) for a in ctxArgs.expressionList().expression()] 312 | 313 | elif ctxArgs.nameValueList(): 314 | for nameValue in ctxArgs.nameValueList().nameValue(): 315 | args.append(self.visit(nameValue.expression())) 316 | names.append(nameValue.identifier().getText()) 317 | 318 | return Node(ctx=ctx, 319 | type='FunctionCall', 320 | expression=self.visit(ctx.expression()), 321 | arguments=args, 322 | names=names) 323 | 324 | def visitEmitStatement(self, ctx): 325 | return Node(ctx=ctx, 326 | type='EmitStatement', 327 | eventCall=self.visit(ctx.getChild(1))) 328 | 329 | def visitThrowStatement(self, ctx): 330 | return Node(ctx=ctx, 331 | type='ThrowStatement') 332 | 333 | def visitStructDefinition(self, ctx): 334 | return Node(ctx=ctx, 335 | type='StructDefinition', 336 | name=ctx.identifier().getText(), 337 | members=self.visit(ctx.variableDeclaration())) 338 | 339 | def visitVariableDeclaration(self, ctx): 340 | storageLocation = None 341 | 342 | if ctx.storageLocation(): 343 | storageLocation = ctx.storageLocation().getText() 344 | 345 | return Node(ctx=ctx, 346 | type='VariableDeclaration', 347 | typeName=self.visit(ctx.typeName()), 348 | name=ctx.identifier().getText(), 349 | storageLocation=storageLocation) 350 | 351 | def visitEventParameter(self, ctx): 352 | storageLocation = None 353 | 354 | # TODO: fixme 355 | 356 | # if (ctx.storageLocation(0)): 357 | # storageLocation = ctx.storageLocation(0).getText() 358 | 359 | return Node(ctx=ctx, 360 | type='VariableDeclaration', 361 | typeName=self.visit(ctx.typeName()), 362 | name=ctx.identifier().getText(), 363 | storageLocation=storageLocation, 364 | isStateVar=False, 365 | isIndexed=not not ctx.IndexedKeyword()) 366 | 367 | def visitFunctionTypeParameter(self, ctx): 368 | storageLocation = None 369 | 370 | if ctx.storageLocation(): 371 | storageLocation = ctx.storageLocation().getText() 372 | 373 | return Node(ctx=ctx, 374 | type='VariableDeclaration', 375 | typeName=self.visit(ctx.typeName()), 376 | name=None, 377 | storageLocation=storageLocation, 378 | isStateVar=False, 379 | isIndexed=False) 380 | 381 | def visitWhileStatement(self, ctx): 382 | return Node(ctx=ctx, 383 | type='WhileStatement', 384 | condition=self.visit(ctx.expression()), 385 | body=self.visit(ctx.statement())) 386 | 387 | def visitDoWhileStatement(self, ctx): 388 | return Node(ctx=ctx, 389 | type='DoWhileStatement', 390 | condition=self.visit(ctx.expression()), 391 | body=self.visit(ctx.statement())) 392 | 393 | def visitIfStatement(self, ctx): 394 | 395 | TrueBody = self.visit(ctx.statement(0)) 396 | 397 | FalseBody = None 398 | if len(ctx.statement()) > 1: 399 | FalseBody = self.visit(ctx.statement(1)) 400 | 401 | return Node(ctx=ctx, 402 | type='IfStatement', 403 | condition=self.visit(ctx.expression()), 404 | TrueBody=TrueBody, 405 | FalseBody=FalseBody) 406 | 407 | def visitTryStatement(self, ctx): 408 | return Node(ctx=ctx, 409 | type='TryStatement', 410 | expression=self.visit(ctx.expression()), 411 | block=self.visit(ctx.block()), 412 | returnParameters=self.visit(ctx.returnParameters()), 413 | catchClause=self.visit(ctx.catchClause())) 414 | 415 | def visitCatchClause(self, ctx): 416 | return Node(ctx=ctx, 417 | type='CatchClause', 418 | identifier=self.visit(ctx.identifier()), 419 | parameterList=self.visit(ctx.parameterList()), 420 | block=self.visit(ctx.block())) 421 | 422 | def visitUserDefinedTypeName(self, ctx): 423 | return Node(ctx=ctx, 424 | type='UserDefinedTypeName', 425 | namePath=ctx.getText()) 426 | 427 | def visitElementaryTypeName(self, ctx): 428 | return Node(ctx=ctx, 429 | type='ElementaryTypeName', 430 | name=ctx.getText()) 431 | 432 | def visitBlock(self, ctx): 433 | return Node(ctx=ctx, 434 | type='Block', 435 | statements=self.visit(ctx.statement())) 436 | 437 | def visitExpressionStatement(self, ctx): 438 | return Node(ctx=ctx, 439 | type='ExpressionStatement', 440 | expression=self.visit(ctx.expression())) 441 | 442 | def visitNumberLiteral(self, ctx): 443 | number = ctx.getChild(0).getText() 444 | subdenomination = None 445 | 446 | if len(ctx.children) == 2: 447 | subdenomination = ctx.getChild(1).getText() 448 | 449 | return Node(ctx=ctx, 450 | type='NumberLiteral', 451 | number=number, 452 | subdenomination=subdenomination) 453 | 454 | def visitMapping(self, ctx): 455 | return Node(ctx=ctx, 456 | type='Mapping', 457 | keyType=self.visit(ctx.mappingKey()), 458 | valueType=self.visit(ctx.typeName())) 459 | 460 | def visitModifierDefinition(self, ctx): 461 | parameters = [] 462 | 463 | if ctx.parameterList(): 464 | parameters = self.visit(ctx.parameterList()) 465 | 466 | return Node(ctx=ctx, 467 | type='ModifierDefinition', 468 | name=ctx.identifier().getText(), 469 | parameters=parameters, 470 | body=self.visit(ctx.block())) 471 | 472 | def visitStatement(self, ctx): 473 | return self.visit(ctx.getChild(0)) 474 | 475 | def visitSimpleStatement(self, ctx): 476 | return self.visit(ctx.getChild(0)) 477 | 478 | def visitUncheckedStatement(self, ctx): 479 | return Node(ctx=ctx, 480 | type='UncheckedStatement', 481 | body=self.visit(ctx.block())) 482 | 483 | def visitRevertStatement(self, ctx): 484 | return Node(ctx=ctx, 485 | type='RevertStatement', 486 | functionCall=self.visit(ctx.functionCall())) 487 | 488 | def visitExpression(self, ctx): 489 | 490 | children_length = len(ctx.children) 491 | if children_length == 1: 492 | return self.visit(ctx.getChild(0)) 493 | 494 | elif children_length == 2: 495 | op = ctx.getChild(0).getText() 496 | if op == 'new': 497 | return Node(ctx=ctx, 498 | type='NewExpression', 499 | typeName=self.visit(ctx.typeName())) 500 | 501 | if op in ['+', '-', '++', '--', '!', '~', 'after', 'delete']: 502 | return Node(ctx=ctx, 503 | type='UnaryOperation', 504 | operator=op, 505 | subExpression=self.visit(ctx.getChild(1)), 506 | isPrefix=True) 507 | 508 | op = ctx.getChild(1).getText() 509 | if op in ['++', '--']: 510 | return Node(ctx=ctx, 511 | type='UnaryOperation', 512 | operator=op, 513 | subExpression=self.visit(ctx.getChild(0)), 514 | isPrefix=False) 515 | elif children_length == 3: 516 | if ctx.getChild(0).getText() == '(' and ctx.getChild(2).getText() == ')': 517 | return Node(ctx=ctx, 518 | type='TupleExpression', 519 | components=[self.visit(ctx.getChild(1))], 520 | isArray=False) 521 | 522 | op = ctx.getChild(1).getText() 523 | 524 | if op == ',': 525 | return Node(ctx=ctx, 526 | type='TupleExpression', 527 | components=[ 528 | self.visit(ctx.getChild(0)), 529 | self.visit(ctx.getChild(2)) 530 | ], 531 | isArray=False) 532 | 533 | 534 | elif op == '.': 535 | expression = self.visit(ctx.getChild(0)) 536 | memberName = ctx.getChild(2).getText() 537 | return Node(ctx=ctx, 538 | type='MemberAccess', 539 | expression=expression, 540 | memberName=memberName) 541 | 542 | binOps = [ 543 | '+', 544 | '-', 545 | '*', 546 | '/', 547 | '**', 548 | '%', 549 | '<<', 550 | '>>', 551 | '&&', 552 | '||', 553 | '&', 554 | '|', 555 | '^', 556 | '<', 557 | '>', 558 | '<=', 559 | '>=', 560 | '==', 561 | '!=', 562 | '=', 563 | '|=', 564 | '^=', 565 | '&=', 566 | '<<=', 567 | '>>=', 568 | '+=', 569 | '-=', 570 | '*=', 571 | '/=', 572 | '%=' 573 | ] 574 | 575 | if op in binOps: 576 | return Node(ctx=ctx, 577 | type='BinaryOperation', 578 | operator=op, 579 | left=self.visit(ctx.getChild(0)), 580 | right=self.visit(ctx.getChild(2))) 581 | 582 | elif children_length == 4: 583 | 584 | if ctx.getChild(1).getText() == '(' and ctx.getChild(3).getText() == ')': 585 | args = [] 586 | names = [] 587 | 588 | ctxArgs = ctx.functionCallArguments() 589 | if ctxArgs.expressionList(): 590 | args = [self.visit(a) for a in ctxArgs.expressionList().expression()] 591 | elif ctxArgs.nameValueList(): 592 | for nameValue in ctxArgs.nameValueList().nameValue(): 593 | args.append(self.visit(nameValue.expression())) 594 | names.append(nameValue.identifier().getText()) 595 | 596 | return Node(ctx=ctx, 597 | type='FunctionCall', 598 | expression=self.visit(ctx.getChild(0)), 599 | arguments=args, 600 | names=names) 601 | 602 | if ctx.getChild(1).getText() == '[' and ctx.getChild(3).getText() == ']': 603 | return Node(ctx=ctx, 604 | type='IndexAccess', 605 | base=self.visit(ctx.getChild(0)), 606 | index=self.visit(ctx.getChild(2))) 607 | 608 | elif children_length == 5: 609 | # ternary 610 | if ctx.getChild(1).getText() == '?' and ctx.getChild(3).getText() == ':': 611 | return Node(ctx=ctx, 612 | type='Conditional', 613 | condition=self.visit(ctx.getChild(0)), 614 | TrueExpression=self.visit(ctx.getChild(2)), 615 | FalseExpression=self.visit(ctx.getChild(4))) 616 | 617 | return self.visit(list(ctx.getChildren())) 618 | 619 | 620 | def visitStateVariableDeclaration(self, ctx): 621 | type = self.visit(ctx.typeName()) 622 | iden = ctx.identifier() 623 | name = iden.getText() 624 | 625 | expression = None 626 | 627 | if ctx.expression(): 628 | expression = self.visit(ctx.expression()) 629 | 630 | visibility = 'default' 631 | 632 | if ctx.InternalKeyword(0): 633 | visibility = 'internal' 634 | elif ctx.PublicKeyword(0): 635 | visibility = 'public' 636 | elif ctx.PrivateKeyword(0): 637 | visibility = 'private' 638 | 639 | isDeclaredConst = False 640 | if ctx.ConstantKeyword(0): 641 | isDeclaredConst = True 642 | 643 | decl = self._createNode( 644 | ctx=ctx, 645 | type='VariableDeclaration', 646 | typeName=type, 647 | name=name, 648 | expression=expression, 649 | visibility=visibility, 650 | isStateVar=True, 651 | isDeclaredConst=isDeclaredConst, 652 | isIndexed=False) 653 | 654 | return Node(ctx=ctx, 655 | type='StateVariableDeclaration', 656 | variables=[decl], 657 | initialValue=expression) 658 | 659 | def visitForStatement(self, ctx): 660 | conditionExpression = self.visit(ctx.expressionStatement()) if ctx.expressionStatement() else None 661 | 662 | if conditionExpression: 663 | conditionExpression = conditionExpression.expression 664 | 665 | return Node(ctx=ctx, 666 | type='ForStatement', 667 | initExpression=self.visit(ctx.simpleStatement()), 668 | conditionExpression=conditionExpression, 669 | loopExpression=Node(ctx=ctx, 670 | type='ExpressionStatement', 671 | expression=self.visit(ctx.expression())), 672 | body=self.visit(ctx.statement()) 673 | ) 674 | 675 | def visitPrimaryExpression(self, ctx): 676 | if ctx.BooleanLiteral(): 677 | return Node(ctx=ctx, 678 | type='BooleanLiteral', 679 | value=ctx.BooleanLiteral().getText() == 'true') 680 | 681 | if ctx.hexLiteral(): 682 | return Node(ctx=ctx, 683 | type='hexLiteral', 684 | value=ctx.hexLiteral().getText()) 685 | 686 | if ctx.stringLiteral(): 687 | text = ctx.getText() 688 | return Node(ctx=ctx, 689 | type='stringLiteral', 690 | value=text[1: len(text) - 1]) 691 | 692 | if len(ctx.children) == 3 and ctx.getChild(1).getText() == '[' and ctx.getChild(2).getText() == ']': 693 | node = self.visit(ctx.getChild(0)) 694 | if node.type == 'Identifier': 695 | node = Node(ctx=ctx, 696 | type='UserDefinedTypeName', 697 | namePath=node.name) 698 | else: 699 | node = Node(ctx=ctx, 700 | type='ElementaryTypeName', 701 | name=ctx.getChild(0).getText()) 702 | 703 | return Node(ctx=ctx, 704 | type='ArrayTypeName', 705 | baseTypeName=node, 706 | length=None) 707 | 708 | return self.visit(ctx.getChild(0)) 709 | 710 | def visitIdentifier(self, ctx): 711 | return Node(ctx=ctx, 712 | type="Identifier", 713 | name=ctx.getText()) 714 | 715 | def visitTupleExpression(self, ctx): 716 | children = ctx.children[1:-1] 717 | components = [None if e is None else self.visit(e) for e in self._mapCommasToNulls(children)] 718 | 719 | return Node(ctx=ctx, 720 | type='TupleExpression', 721 | components=components, 722 | isArray=ctx.getChild(0).getText() == '[') 723 | 724 | def visitIdentifierList(self, ctx: SolidityParser.IdentifierListContext): 725 | children = ctx.children[1:-1] 726 | 727 | result = [] 728 | for iden in self._mapCommasToNulls(children): 729 | if iden == None: 730 | result.append(None) 731 | else: 732 | result.append(self._createNode(ctx=ctx, 733 | type="VariableDeclaration", 734 | name=iden.getText(), 735 | isStateVar=False, 736 | isIndexed=False, 737 | iden=iden)) 738 | 739 | return result 740 | 741 | def visitVariableDeclarationList(self, ctx: SolidityParser.VariableDeclarationListContext): 742 | result = [] 743 | for decl in self._mapCommasToNulls(ctx.children): 744 | if decl == None: 745 | return None 746 | 747 | result.append(self._createNode(ctx=ctx, 748 | type='VariableDeclaration', 749 | name=decl.identifier().getText(), 750 | typeName=self.visit(decl.typeName()), 751 | isStateVar=False, 752 | isIndexed=False, 753 | decl=decl)) 754 | 755 | return result 756 | 757 | def visitVariableDeclarationStatement(self, ctx): 758 | 759 | if ctx.variableDeclaration(): 760 | variables = [self.visit(ctx.variableDeclaration())] 761 | elif ctx.identifierList(): 762 | variables = self.visit(ctx.identifierList()) 763 | elif ctx.variableDeclarationList(): 764 | variables = self.visit(ctx.variableDeclarationList()) 765 | 766 | initialValue = None 767 | 768 | if ctx.expression(): 769 | initialValue = self.visit(ctx.expression()) 770 | 771 | return Node(ctx=ctx, 772 | type='VariableDeclarationStatement', 773 | variables=variables, 774 | initialValue=initialValue) 775 | 776 | def visitEventDefinition(self, ctx): 777 | return Node(ctx=ctx, 778 | type='EventDefinition', 779 | name=ctx.identifier().getText(), 780 | parameters=self.visit(ctx.eventParameterList()), 781 | isAnonymous=not not ctx.AnonymousKeyword()) 782 | 783 | def visitEventParameterList(self, ctx): 784 | parameters = [] 785 | for paramCtx in ctx.eventParameter(): 786 | type = self.visit(paramCtx.typeName()) 787 | name = None 788 | if paramCtx.identifier(): 789 | name = paramCtx.identifier().getText() 790 | 791 | parameters.append(self._createNode(ctx=ctx, 792 | type='VariableDeclaration', 793 | typeName=type, 794 | name=name, 795 | isStateVar=False, 796 | isIndexed=not not paramCtx.IndexedKeyword())) 797 | 798 | return Node(ctx=ctx, 799 | type='ParameterList', 800 | parameters=parameters) 801 | 802 | def visitInlineAssemblyStatement(self, ctx): 803 | language = None 804 | 805 | if ctx.StringLiteralFragment(): 806 | language = ctx.StringLiteralFragment().getText() 807 | language = language[1: len(language) - 1] 808 | 809 | return Node(ctx=ctx, 810 | type='InLineAssemblyStatement', 811 | language=language, 812 | body=self.visit(ctx.assemblyBlock())) 813 | 814 | def visitAssemblyBlock(self, ctx): 815 | operations = [self.visit(it) for it in ctx.assemblyItem()] 816 | 817 | return Node(ctx=ctx, 818 | type='AssemblyBlock', 819 | operations=operations) 820 | 821 | def visitAssemblyItem(self, ctx): 822 | 823 | if ctx.hexLiteral(): 824 | return Node(ctx=ctx, 825 | type='HexLiteral', 826 | value=ctx.hexLiteral().getText()) 827 | 828 | if ctx.stringLiteral(): 829 | text = ctx.stringLiteral().getText() 830 | return Node(ctx=ctx, 831 | type='StringLiteral', 832 | value=text[1: len(text) - 1]) 833 | 834 | if ctx.BreakKeyword(): 835 | return Node(ctx=ctx, 836 | type='Break') 837 | 838 | if ctx.ContinueKeyword(): 839 | return Node(ctx=ctx, 840 | type='Continue') 841 | 842 | return self.visit(ctx.getChild(0)) 843 | 844 | def visitAssemblyExpression(self, ctx): 845 | return self.visit(ctx.getChild(0)) 846 | 847 | def visitAssemblyMember(self, ctx): 848 | return Node(ctx=ctx, 849 | type='AssemblyMember', 850 | name=ctx.identifier().getText()) 851 | 852 | def visitAssemblyCall(self, ctx): 853 | functionName = ctx.getChild(0).getText() 854 | args = [self.visit(arg) for arg in ctx.assemblyExpression()] 855 | 856 | return Node(ctx=ctx, 857 | type='AssemblyExpression', 858 | functionName=functionName, 859 | arguments=args) 860 | 861 | def visitAssemblyLiteral(self, ctx): 862 | 863 | if ctx.stringLiteral(): 864 | text = ctx.getText() 865 | return Node(ctx=ctx, 866 | type='StringLiteral', 867 | value=text[1: len(text) - 1]) 868 | 869 | if ctx.DecimalNumber(): 870 | return Node(ctx=ctx, 871 | type='DecimalNumber', 872 | value=ctx.getText()) 873 | 874 | if ctx.HexNumber(): 875 | return Node(ctx=ctx, 876 | type='HexNumber', 877 | value=ctx.getText()) 878 | 879 | if ctx.hexLiteral(): 880 | return Node(ctx=ctx, 881 | type='HexLiteral', 882 | value=ctx.getText()) 883 | 884 | def visitAssemblySwitch(self, ctx): 885 | return Node(ctx=ctx, 886 | type='AssemblySwitch', 887 | expression=self.visit(ctx.assemblyExpression()), 888 | cases=[self.visit(c) for c in ctx.assemblyCase()]) 889 | 890 | def visitAssemblyCase(self, ctx): 891 | value = None 892 | 893 | if ctx.getChild(0).getText() == 'case': 894 | value = self.visit(ctx.assemblyLiteral()) 895 | 896 | if value != None: 897 | node = Node(ctx=ctx, 898 | type="AssemblyCase", 899 | block=self.visit(ctx.assemblyBlock()), 900 | value=value) 901 | else: 902 | node = Node(ctx=ctx, 903 | type="AssemblyCase", 904 | block=self.visit(ctx.assemblyBlock()), 905 | default=True) 906 | 907 | return node 908 | 909 | def visitAssemblyLocalDefinition(self, ctx): 910 | names = ctx.assemblyIdentifierOrList() 911 | 912 | if names.identifier(): 913 | names = [self.visit(names.identifier())] 914 | else: 915 | names = self.visit(names.assemblyIdentifierList().identifier()) 916 | 917 | return Node(ctx=ctx, 918 | type='AssemblyLocalDefinition', 919 | names=names, 920 | expression=self.visit(ctx.assemblyExpression())) 921 | 922 | def visitAssemblyFunctionDefinition(self, ctx): 923 | args = ctx.assemblyIdentifierList().identifier() 924 | returnArgs = ctx.assemblyFunctionReturns().assemblyIdentifierList().identifier() 925 | 926 | return Node(ctx=ctx, 927 | type='AssemblyFunctionDefinition', 928 | name=ctx.identifier().getText(), 929 | arguments=self.visit(args), 930 | returnArguments=self.visit(returnArgs), 931 | body=self.visit(ctx.assemblyBlock())) 932 | 933 | def visitAssemblyAssignment(self, ctx): 934 | names = ctx.assemblyIdentifierOrList() 935 | 936 | if names.identifier(): 937 | names = [self.visit(names.identifier())] 938 | else: 939 | names = self.visit(names.assemblyIdentifierList().identifier()) 940 | 941 | return Node(ctx=ctx, 942 | type='AssemblyAssignment', 943 | names=names, 944 | expression=self.visit(ctx.assemblyExpression())) 945 | 946 | def visitLabelDefinition(self, ctx): 947 | return Node(ctx=ctx, 948 | type='LabelDefinition', 949 | name=ctx.identifier().getText()) 950 | 951 | def visitAssemblyStackAssignment(self, ctx): 952 | return Node(ctx=ctx, 953 | type='AssemblyStackAssignment', 954 | name=ctx.identifier().getText()) 955 | 956 | def visitAssemblyFor(self, ctx): 957 | return Node(ctx=ctx, 958 | type='AssemblyFor', 959 | pre=self.visit(ctx.getChild(1)), 960 | condition=self.visit(ctx.getChild(2)), 961 | post=self.visit(ctx.getChild(3)), 962 | body=self.visit(ctx.getChild(4))) 963 | 964 | def visitAssemblyIf(self, ctx): 965 | return Node(ctx=ctx, 966 | type='AssemblyIf', 967 | condition=self.visit(ctx.assemblyExpression()), 968 | body=self.visit(ctx.assemblyBlock())) 969 | 970 | ### /*************************************************** 971 | 972 | def visitPragmaDirective(self, ctx): 973 | return Node(ctx=ctx, 974 | type="PragmaDirective", 975 | name=ctx.pragmaName().getText(), 976 | value=ctx.pragmaValue().getText()) 977 | 978 | def visitImportDirective(self, ctx): 979 | symbol_aliases = {} 980 | unit_alias = None 981 | 982 | if len(ctx.importDeclaration()) > 0: 983 | for item in ctx.importDeclaration(): 984 | 985 | try: 986 | alias = item.identifier(1).getText() 987 | except: 988 | alias = None 989 | symbol_aliases[item.identifier(0).getText()] = alias 990 | 991 | elif len(ctx.children) == 7: 992 | unit_alias = ctx.getChild(3).getText() 993 | 994 | elif len(ctx.children) == 5: 995 | unit_alias = ctx.getChild(3).getText() 996 | 997 | return Node(ctx=ctx, 998 | type="ImportDirective", 999 | path=ctx.importPath().getText().strip('"'), 1000 | symbolAliases=symbol_aliases, 1001 | unitAlias=unit_alias 1002 | ) 1003 | 1004 | def visitContractDefinition(self, ctx): 1005 | self._currentContract = ctx.identifier().getText() 1006 | return Node(ctx=ctx, 1007 | type="ContractDefinition", 1008 | name=ctx.identifier().getText(), 1009 | baseContracts=self.visit(ctx.inheritanceSpecifier()), 1010 | subNodes=self.visit(ctx.contractPart()), 1011 | kind=ctx.getChild(0).getText()) 1012 | 1013 | def visitUserDefinedTypename(self, ctx): 1014 | return Node(ctx=ctx, 1015 | type="UserDefinedTypename", 1016 | name=ctx.getText()) 1017 | 1018 | def visitReturnStatement(self, ctx): 1019 | return self.visit(ctx.expression()) 1020 | 1021 | def visitTerminal(self, ctx): 1022 | return ctx.getText() 1023 | 1024 | 1025 | def parse(text, start="sourceUnit", loc=False, strict=False): 1026 | from antlr4.InputStream import InputStream 1027 | from antlr4 import FileStream, CommonTokenStream 1028 | 1029 | input_stream = InputStream(text) 1030 | 1031 | lexer = SolidityLexer(input_stream) 1032 | token_stream = CommonTokenStream(lexer) 1033 | parser = SolidityParser(token_stream) 1034 | ast = AstVisitor() 1035 | 1036 | Node.ENABLE_LOC = loc 1037 | 1038 | return ast.visit(getattr(parser, start)()) 1039 | 1040 | 1041 | def parse_file(path, start="sourceUnit", loc=False, strict=False): 1042 | with open(path, 'r', encoding="utf-8") as f: 1043 | return parse(f.read(), start=start, loc=loc, strict=strict) 1044 | 1045 | 1046 | def visit(node, callback_object): 1047 | """ 1048 | 1049 | Walks the AST produced by parse/parse_file and calls callback_object.visit 1050 | 1051 | :param node: ASTNode returned from parse() 1052 | :param callback: an object implementing the visitor pattern 1053 | :return: 1054 | """ 1055 | 1056 | if node is None or not isinstance(node, Node): 1057 | return node 1058 | 1059 | # call callback if it is available 1060 | if hasattr(callback_object, "visit"+node.type): 1061 | getattr(callback_object, "visit"+node.type)(node) 1062 | 1063 | for k,v in node.items(): 1064 | if k in node.NONCHILD_KEYS: 1065 | # skip non child items 1066 | continue 1067 | 1068 | # item is array? 1069 | if isinstance(v, list): 1070 | [visit(child, callback_object) for child in v] 1071 | else: 1072 | visit(v, callback_object) 1073 | 1074 | 1075 | def objectify(start_node): 1076 | """ 1077 | Create an OOP like structure from the tree for easy access of most common information 1078 | 1079 | sourceUnit 1080 | .pragmas [] 1081 | .imports [] 1082 | .contracts { name: contract} 1083 | .statevars 1084 | .enums 1085 | .structs 1086 | .functions 1087 | .modifiers 1088 | . 1089 | 1090 | :param tree: 1091 | :return: 1092 | """ 1093 | 1094 | current_contract = None 1095 | current_function = None 1096 | 1097 | class ObjectifyContractVisitor(object): 1098 | 1099 | def __init__(self, node): 1100 | self._node = node 1101 | self.name = node.name 1102 | 1103 | self.dependencies = [] 1104 | self.stateVars = {} 1105 | self.names = {} 1106 | self.enums = {} 1107 | self.structs = {} 1108 | self.mappings = {} 1109 | self.events = {} 1110 | self.modifiers = {} 1111 | self.functions = {} 1112 | self.constructor = None 1113 | self.inherited_names = {} 1114 | 1115 | 1116 | def visitEnumDefinition(self, _node): 1117 | self.enums[_node.name]=_node 1118 | self.names[_node.name]=_node 1119 | 1120 | def visitStructDefinition(self, _node): 1121 | self.structs[_node.name]=_node 1122 | self.names[_node.name]=_node 1123 | 1124 | def visitStateVariableDeclaration(self, _node): 1125 | 1126 | class VarDecVisitor(object): 1127 | 1128 | def __init__(self, current_contract): 1129 | self._current_contract = current_contract 1130 | 1131 | def visitVariableDeclaration(self, __node): 1132 | self._current_contract.stateVars[__node.name] = __node 1133 | self._current_contract.names[__node.name] = __node 1134 | 1135 | visit(_node, VarDecVisitor(self)) 1136 | 1137 | def visitEventDefinition(self, _node): 1138 | 1139 | class EventFunctionVisitor(object): 1140 | def __init__(self, node): 1141 | self.arguments = {} 1142 | self.declarations = {} 1143 | self._node = node 1144 | 1145 | def visitVariableDeclaration(self, __node): 1146 | self.arguments[__node.name] = __node 1147 | self.declarations[__node.name] = __node 1148 | 1149 | current_function = EventFunctionVisitor(_node) 1150 | visit(_node, current_function) 1151 | self.names[_node.name] = current_function 1152 | self.events[_node.name] = current_function 1153 | 1154 | 1155 | def visitFunctionDefinition(self, _node, _definition_type=None): 1156 | 1157 | class FunctionObject(object): 1158 | 1159 | def __init__(self, node): 1160 | self._node = node 1161 | if(node.type=="FunctionDefinition"): 1162 | self.visibility = node.visibility 1163 | self.stateMutability = node.stateMutability 1164 | self.isConstructor = node.isConstructor 1165 | self.isFallback = node.isFallback 1166 | self.isReceive = node.isReceive 1167 | self.arguments = {} 1168 | self.returns = {} 1169 | self.declarations = {} 1170 | self.identifiers = [] 1171 | 1172 | 1173 | 1174 | class FunctionArgumentVisitor(object): 1175 | 1176 | def __init__(self): 1177 | self.parameters = {} 1178 | 1179 | def visitParameter(self, __node): 1180 | self.parameters[__node.name] = __node 1181 | 1182 | class VarDecVisitor(object): 1183 | 1184 | def __init__(self): 1185 | self.variable_declarations = {} 1186 | 1187 | def visitVariableDeclaration(self, __node): 1188 | self.variable_declarations[__node.name] = __node 1189 | 1190 | class IdentifierDecVisitor(object): 1191 | 1192 | def __init__(self): 1193 | self.idents = [] 1194 | 1195 | def visitIdentifier(self, __node): 1196 | self.idents.append(__node) 1197 | 1198 | def visitAssemblyCall(self, __node): 1199 | self.idents.append(__node) 1200 | 1201 | current_function = FunctionObject(_node) 1202 | self.names[_node.name] = current_function 1203 | if _definition_type=="ModifierDefinition": 1204 | self.modifiers[_node.name] = current_function 1205 | else: 1206 | self.functions[_node.name] = current_function 1207 | if current_function.isConstructor: 1208 | self.constructor = current_function 1209 | 1210 | ## get parameters 1211 | funcargvisitor = FunctionArgumentVisitor() 1212 | visit(_node.parameters, funcargvisitor) 1213 | current_function.arguments = funcargvisitor.parameters 1214 | current_function.declarations.update(current_function.arguments) 1215 | 1216 | 1217 | ## get returnParams 1218 | if _node.get("returnParameters"): 1219 | # because modifiers dont 1220 | funcargvisitor = FunctionArgumentVisitor() 1221 | visit(_node.returnParameters, funcargvisitor) 1222 | current_function.returns = funcargvisitor.parameters 1223 | current_function.declarations.update(current_function.returns) 1224 | 1225 | 1226 | ## get vardecs in body 1227 | vardecs = VarDecVisitor() 1228 | visit(_node.body, vardecs) 1229 | current_function.declarations.update(vardecs.variable_declarations) 1230 | 1231 | ## get all identifiers 1232 | idents = IdentifierDecVisitor() 1233 | visit(_node, idents) 1234 | current_function.identifiers = idents 1235 | 1236 | def visitModifierDefinition(self, _node): 1237 | return self.visitFunctionDefinition(_node, "ModifierDefinition") 1238 | 1239 | 1240 | class ObjectifySourceUnitVisitor(object): 1241 | 1242 | def __init__(self, node): 1243 | self._node = node 1244 | self.imports = [] 1245 | self.pragmas = [] 1246 | self.contracts = {} 1247 | 1248 | self._current_contract = None 1249 | 1250 | def visitPragmaDirective(self, node): 1251 | self.pragmas.append(node) 1252 | 1253 | def visitImportDirective(self, node): 1254 | self.imports.append(node) 1255 | 1256 | def visitContractDefinition(self, node): 1257 | self.contracts[node.name] = ObjectifyContractVisitor(node) 1258 | self._current_contract = self.contracts[node.name] 1259 | 1260 | # subparse the contracts //slightly inefficient but more readable :) 1261 | visit(node, self.contracts[node.name]) 1262 | 1263 | objectified_source_unit = ObjectifySourceUnitVisitor(start_node) 1264 | visit(start_node, objectified_source_unit) 1265 | return objectified_source_unit 1266 | -------------------------------------------------------------------------------- /solidity_parser/solidity_antlr4/Solidity.interp: -------------------------------------------------------------------------------- 1 | token literal names: 2 | null 3 | 'pragma' 4 | ';' 5 | '||' 6 | '^' 7 | '~' 8 | '>=' 9 | '>' 10 | '<' 11 | '<=' 12 | '=' 13 | 'as' 14 | 'import' 15 | '*' 16 | 'from' 17 | '{' 18 | ',' 19 | '}' 20 | 'abstract' 21 | 'contract' 22 | 'interface' 23 | 'library' 24 | 'is' 25 | '(' 26 | ')' 27 | 'error' 28 | 'using' 29 | 'for' 30 | 'struct' 31 | 'modifier' 32 | 'function' 33 | 'returns' 34 | 'event' 35 | 'enum' 36 | '[' 37 | ']' 38 | 'address' 39 | '.' 40 | 'mapping' 41 | '=>' 42 | 'memory' 43 | 'storage' 44 | 'calldata' 45 | 'if' 46 | 'else' 47 | 'try' 48 | 'catch' 49 | 'while' 50 | 'unchecked' 51 | 'assembly' 52 | 'do' 53 | 'return' 54 | 'throw' 55 | 'emit' 56 | 'revert' 57 | 'var' 58 | 'bool' 59 | 'string' 60 | 'byte' 61 | '++' 62 | '--' 63 | 'new' 64 | ':' 65 | '+' 66 | '-' 67 | 'after' 68 | 'delete' 69 | '!' 70 | '**' 71 | '/' 72 | '%' 73 | '<<' 74 | '>>' 75 | '&' 76 | '|' 77 | '==' 78 | '!=' 79 | '&&' 80 | '?' 81 | '|=' 82 | '^=' 83 | '&=' 84 | '<<=' 85 | '>>=' 86 | '+=' 87 | '-=' 88 | '*=' 89 | '/=' 90 | '%=' 91 | 'let' 92 | ':=' 93 | '=:' 94 | 'switch' 95 | 'case' 96 | 'default' 97 | '->' 98 | 'callback' 99 | 'override' 100 | null 101 | null 102 | null 103 | null 104 | null 105 | null 106 | null 107 | null 108 | null 109 | null 110 | null 111 | 'anonymous' 112 | 'break' 113 | 'constant' 114 | 'immutable' 115 | 'continue' 116 | 'leave' 117 | 'external' 118 | 'indexed' 119 | 'internal' 120 | 'payable' 121 | 'private' 122 | 'public' 123 | 'virtual' 124 | 'pure' 125 | 'type' 126 | 'view' 127 | 'constructor' 128 | 'fallback' 129 | 'receive' 130 | null 131 | null 132 | null 133 | null 134 | null 135 | null 136 | 137 | token symbolic names: 138 | null 139 | null 140 | null 141 | null 142 | null 143 | null 144 | null 145 | null 146 | null 147 | null 148 | null 149 | null 150 | null 151 | null 152 | null 153 | null 154 | null 155 | null 156 | null 157 | null 158 | null 159 | null 160 | null 161 | null 162 | null 163 | null 164 | null 165 | null 166 | null 167 | null 168 | null 169 | null 170 | null 171 | null 172 | null 173 | null 174 | null 175 | null 176 | null 177 | null 178 | null 179 | null 180 | null 181 | null 182 | null 183 | null 184 | null 185 | null 186 | null 187 | null 188 | null 189 | null 190 | null 191 | null 192 | null 193 | null 194 | null 195 | null 196 | null 197 | null 198 | null 199 | null 200 | null 201 | null 202 | null 203 | null 204 | null 205 | null 206 | null 207 | null 208 | null 209 | null 210 | null 211 | null 212 | null 213 | null 214 | null 215 | null 216 | null 217 | null 218 | null 219 | null 220 | null 221 | null 222 | null 223 | null 224 | null 225 | null 226 | null 227 | null 228 | null 229 | null 230 | null 231 | null 232 | null 233 | null 234 | null 235 | null 236 | Int 237 | Uint 238 | Byte 239 | Fixed 240 | Ufixed 241 | BooleanLiteral 242 | DecimalNumber 243 | HexNumber 244 | NumberUnit 245 | HexLiteralFragment 246 | ReservedKeyword 247 | AnonymousKeyword 248 | BreakKeyword 249 | ConstantKeyword 250 | ImmutableKeyword 251 | ContinueKeyword 252 | LeaveKeyword 253 | ExternalKeyword 254 | IndexedKeyword 255 | InternalKeyword 256 | PayableKeyword 257 | PrivateKeyword 258 | PublicKeyword 259 | VirtualKeyword 260 | PureKeyword 261 | TypeKeyword 262 | ViewKeyword 263 | ConstructorKeyword 264 | FallbackKeyword 265 | ReceiveKeyword 266 | Identifier 267 | StringLiteralFragment 268 | VersionLiteral 269 | WS 270 | COMMENT 271 | LINE_COMMENT 272 | 273 | rule names: 274 | sourceUnit 275 | pragmaDirective 276 | pragmaName 277 | pragmaValue 278 | version 279 | versionOperator 280 | versionConstraint 281 | importDeclaration 282 | importDirective 283 | importPath 284 | contractDefinition 285 | inheritanceSpecifier 286 | contractPart 287 | stateVariableDeclaration 288 | fileLevelConstant 289 | customErrorDefinition 290 | typeDefinition 291 | usingForDeclaration 292 | structDefinition 293 | modifierDefinition 294 | modifierInvocation 295 | functionDefinition 296 | functionDescriptor 297 | returnParameters 298 | modifierList 299 | eventDefinition 300 | enumValue 301 | enumDefinition 302 | parameterList 303 | parameter 304 | eventParameterList 305 | eventParameter 306 | functionTypeParameterList 307 | functionTypeParameter 308 | variableDeclaration 309 | typeName 310 | userDefinedTypeName 311 | mappingKey 312 | mapping 313 | functionTypeName 314 | storageLocation 315 | stateMutability 316 | block 317 | statement 318 | expressionStatement 319 | ifStatement 320 | tryStatement 321 | catchClause 322 | whileStatement 323 | simpleStatement 324 | uncheckedStatement 325 | forStatement 326 | inlineAssemblyStatement 327 | doWhileStatement 328 | continueStatement 329 | breakStatement 330 | returnStatement 331 | throwStatement 332 | emitStatement 333 | revertStatement 334 | variableDeclarationStatement 335 | variableDeclarationList 336 | identifierList 337 | elementaryTypeName 338 | expression 339 | primaryExpression 340 | expressionList 341 | nameValueList 342 | nameValue 343 | functionCallArguments 344 | functionCall 345 | assemblyBlock 346 | assemblyItem 347 | assemblyExpression 348 | assemblyMember 349 | assemblyCall 350 | assemblyLocalDefinition 351 | assemblyAssignment 352 | assemblyIdentifierOrList 353 | assemblyIdentifierList 354 | assemblyStackAssignment 355 | labelDefinition 356 | assemblySwitch 357 | assemblyCase 358 | assemblyFunctionDefinition 359 | assemblyFunctionReturns 360 | assemblyFor 361 | assemblyIf 362 | assemblyLiteral 363 | subAssembly 364 | tupleExpression 365 | typeNameExpression 366 | numberLiteral 367 | identifier 368 | hexLiteral 369 | overrideSpecifier 370 | stringLiteral 371 | 372 | 373 | atn: 374 | [3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 135, 1133, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 206, 10, 2, 12, 2, 14, 2, 209, 11, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 5, 5, 222, 10, 5, 3, 6, 3, 6, 5, 6, 226, 10, 6, 3, 6, 7, 6, 229, 10, 6, 12, 6, 14, 6, 232, 11, 6, 3, 7, 3, 7, 3, 8, 5, 8, 237, 10, 8, 3, 8, 3, 8, 5, 8, 241, 10, 8, 3, 8, 5, 8, 244, 10, 8, 3, 9, 3, 9, 3, 9, 5, 9, 249, 10, 9, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 255, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 262, 10, 10, 3, 10, 3, 10, 5, 10, 266, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 277, 10, 10, 12, 10, 14, 10, 280, 11, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 287, 10, 10, 3, 11, 3, 11, 3, 12, 5, 12, 292, 10, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 7, 12, 300, 10, 12, 12, 12, 14, 12, 303, 11, 12, 5, 12, 305, 10, 12, 3, 12, 3, 12, 7, 12, 309, 10, 12, 12, 12, 14, 12, 312, 11, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 5, 13, 319, 10, 13, 3, 13, 5, 13, 322, 10, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 333, 10, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 7, 15, 342, 10, 15, 12, 15, 14, 15, 345, 11, 15, 3, 15, 3, 15, 3, 15, 5, 15, 350, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 377, 10, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 389, 10, 20, 12, 20, 14, 20, 392, 11, 20, 5, 20, 394, 10, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 5, 21, 401, 10, 21, 3, 21, 3, 21, 7, 21, 405, 10, 21, 12, 21, 14, 21, 408, 11, 21, 3, 21, 3, 21, 5, 21, 412, 10, 21, 3, 22, 3, 22, 3, 22, 5, 22, 417, 10, 22, 3, 22, 5, 22, 420, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 426, 10, 23, 3, 23, 3, 23, 5, 23, 430, 10, 23, 3, 24, 3, 24, 5, 24, 434, 10, 24, 3, 24, 3, 24, 3, 24, 5, 24, 439, 10, 24, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 7, 26, 452, 10, 26, 12, 26, 14, 26, 455, 11, 26, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 461, 10, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 471, 10, 29, 3, 29, 3, 29, 7, 29, 475, 10, 29, 12, 29, 14, 29, 478, 11, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 7, 30, 486, 10, 30, 12, 30, 14, 30, 489, 11, 30, 5, 30, 491, 10, 30, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 497, 10, 31, 3, 31, 5, 31, 500, 10, 31, 3, 32, 3, 32, 3, 32, 3, 32, 7, 32, 506, 10, 32, 12, 32, 14, 32, 509, 11, 32, 5, 32, 511, 10, 32, 3, 32, 3, 32, 3, 33, 3, 33, 5, 33, 517, 10, 33, 3, 33, 5, 33, 520, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 526, 10, 34, 12, 34, 14, 34, 529, 11, 34, 5, 34, 531, 10, 34, 3, 34, 3, 34, 3, 35, 3, 35, 5, 35, 537, 10, 35, 3, 36, 3, 36, 5, 36, 541, 10, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 552, 10, 37, 3, 37, 3, 37, 3, 37, 5, 37, 557, 10, 37, 3, 37, 7, 37, 560, 10, 37, 12, 37, 14, 37, 563, 11, 37, 3, 38, 3, 38, 3, 38, 7, 38, 568, 10, 38, 12, 38, 14, 38, 571, 11, 38, 3, 39, 3, 39, 5, 39, 575, 10, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 7, 41, 589, 10, 41, 12, 41, 14, 41, 592, 11, 41, 3, 41, 3, 41, 5, 41, 596, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 44, 3, 44, 7, 44, 604, 10, 44, 12, 44, 14, 44, 607, 11, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 5, 45, 626, 10, 45, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 5, 47, 638, 10, 47, 3, 48, 3, 48, 3, 48, 5, 48, 643, 10, 48, 3, 48, 3, 48, 6, 48, 647, 10, 48, 13, 48, 14, 48, 648, 3, 49, 3, 49, 5, 49, 653, 10, 49, 3, 49, 5, 49, 656, 10, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 5, 51, 668, 10, 51, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 5, 53, 677, 10, 53, 3, 53, 3, 53, 5, 53, 681, 10, 53, 3, 53, 5, 53, 684, 10, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 5, 54, 691, 10, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 5, 58, 711, 10, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 5, 62, 733, 10, 62, 3, 62, 3, 62, 5, 62, 737, 10, 62, 3, 62, 3, 62, 3, 63, 5, 63, 742, 10, 63, 3, 63, 3, 63, 5, 63, 746, 10, 63, 7, 63, 748, 10, 63, 12, 63, 14, 63, 751, 11, 63, 3, 64, 3, 64, 5, 64, 755, 10, 64, 3, 64, 7, 64, 758, 10, 64, 12, 64, 14, 64, 761, 11, 64, 3, 64, 5, 64, 764, 10, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 5, 66, 788, 10, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 5, 66, 842, 10, 66, 3, 66, 3, 66, 5, 66, 846, 10, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 862, 10, 66, 12, 66, 14, 66, 865, 11, 66, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 5, 67, 874, 10, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 5, 67, 882, 10, 67, 5, 67, 884, 10, 67, 3, 68, 3, 68, 3, 68, 7, 68, 889, 10, 68, 12, 68, 14, 68, 892, 11, 68, 3, 69, 3, 69, 3, 69, 7, 69, 897, 10, 69, 12, 69, 14, 69, 900, 11, 69, 3, 69, 5, 69, 903, 10, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 71, 3, 71, 5, 71, 911, 10, 71, 3, 71, 3, 71, 5, 71, 915, 10, 71, 5, 71, 917, 10, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 73, 3, 73, 7, 73, 926, 10, 73, 12, 73, 14, 73, 929, 11, 73, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 5, 74, 951, 10, 74, 3, 75, 3, 75, 3, 75, 5, 75, 956, 10, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 5, 77, 966, 10, 77, 3, 77, 3, 77, 5, 77, 970, 10, 77, 3, 77, 3, 77, 7, 77, 974, 10, 77, 12, 77, 14, 77, 977, 11, 77, 3, 77, 5, 77, 980, 10, 77, 3, 78, 3, 78, 3, 78, 3, 78, 5, 78, 986, 10, 78, 3, 79, 3, 79, 3, 79, 3, 79, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 5, 80, 998, 10, 80, 3, 81, 3, 81, 3, 81, 7, 81, 1003, 10, 81, 12, 81, 14, 81, 1006, 11, 81, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 3, 84, 3, 84, 3, 84, 7, 84, 1017, 10, 84, 12, 84, 14, 84, 1020, 11, 84, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 5, 85, 1028, 10, 85, 3, 86, 3, 86, 3, 86, 3, 86, 5, 86, 1034, 10, 86, 3, 86, 3, 86, 5, 86, 1038, 10, 86, 3, 86, 3, 86, 3, 87, 3, 87, 3, 87, 3, 88, 3, 88, 3, 88, 5, 88, 1048, 10, 88, 3, 88, 3, 88, 3, 88, 5, 88, 1053, 10, 88, 3, 88, 3, 88, 3, 89, 3, 89, 3, 89, 3, 89, 3, 90, 3, 90, 3, 90, 3, 90, 5, 90, 1065, 10, 90, 3, 91, 3, 91, 3, 91, 3, 91, 3, 92, 3, 92, 5, 92, 1073, 10, 92, 3, 92, 3, 92, 5, 92, 1077, 10, 92, 7, 92, 1079, 10, 92, 12, 92, 14, 92, 1082, 11, 92, 3, 92, 3, 92, 3, 92, 3, 92, 3, 92, 7, 92, 1089, 10, 92, 12, 92, 14, 92, 1092, 11, 92, 5, 92, 1094, 10, 92, 3, 92, 5, 92, 1097, 10, 92, 3, 93, 3, 93, 5, 93, 1101, 10, 93, 3, 94, 3, 94, 5, 94, 1105, 10, 94, 3, 95, 3, 95, 3, 96, 6, 96, 1110, 10, 96, 13, 96, 14, 96, 1111, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 7, 97, 1119, 10, 97, 12, 97, 14, 97, 1122, 11, 97, 3, 97, 3, 97, 5, 97, 1126, 10, 97, 3, 98, 6, 98, 1129, 10, 98, 13, 98, 14, 98, 1130, 3, 98, 2, 4, 72, 130, 99, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 2, 17, 3, 2, 6, 12, 3, 2, 21, 23, 3, 2, 42, 44, 6, 2, 113, 113, 120, 120, 124, 124, 126, 126, 5, 2, 38, 38, 57, 60, 100, 104, 3, 2, 61, 62, 3, 2, 65, 66, 3, 2, 67, 68, 4, 2, 15, 15, 71, 72, 3, 2, 73, 74, 3, 2, 8, 11, 3, 2, 77, 78, 4, 2, 12, 12, 81, 90, 3, 2, 106, 107, 11, 2, 16, 16, 27, 27, 44, 44, 56, 56, 98, 98, 116, 116, 120, 120, 127, 127, 129, 130, 2, 1258, 2, 207, 3, 2, 2, 2, 4, 212, 3, 2, 2, 2, 6, 217, 3, 2, 2, 2, 8, 221, 3, 2, 2, 2, 10, 223, 3, 2, 2, 2, 12, 233, 3, 2, 2, 2, 14, 243, 3, 2, 2, 2, 16, 245, 3, 2, 2, 2, 18, 286, 3, 2, 2, 2, 20, 288, 3, 2, 2, 2, 22, 291, 3, 2, 2, 2, 24, 315, 3, 2, 2, 2, 26, 332, 3, 2, 2, 2, 28, 334, 3, 2, 2, 2, 30, 353, 3, 2, 2, 2, 32, 360, 3, 2, 2, 2, 34, 365, 3, 2, 2, 2, 36, 371, 3, 2, 2, 2, 38, 380, 3, 2, 2, 2, 40, 397, 3, 2, 2, 2, 42, 413, 3, 2, 2, 2, 44, 421, 3, 2, 2, 2, 46, 438, 3, 2, 2, 2, 48, 440, 3, 2, 2, 2, 50, 453, 3, 2, 2, 2, 52, 456, 3, 2, 2, 2, 54, 464, 3, 2, 2, 2, 56, 466, 3, 2, 2, 2, 58, 481, 3, 2, 2, 2, 60, 494, 3, 2, 2, 2, 62, 501, 3, 2, 2, 2, 64, 514, 3, 2, 2, 2, 66, 521, 3, 2, 2, 2, 68, 534, 3, 2, 2, 2, 70, 538, 3, 2, 2, 2, 72, 551, 3, 2, 2, 2, 74, 564, 3, 2, 2, 2, 76, 574, 3, 2, 2, 2, 78, 576, 3, 2, 2, 2, 80, 583, 3, 2, 2, 2, 82, 597, 3, 2, 2, 2, 84, 599, 3, 2, 2, 2, 86, 601, 3, 2, 2, 2, 88, 625, 3, 2, 2, 2, 90, 627, 3, 2, 2, 2, 92, 630, 3, 2, 2, 2, 94, 639, 3, 2, 2, 2, 96, 650, 3, 2, 2, 2, 98, 659, 3, 2, 2, 2, 100, 667, 3, 2, 2, 2, 102, 669, 3, 2, 2, 2, 104, 672, 3, 2, 2, 2, 106, 688, 3, 2, 2, 2, 108, 694, 3, 2, 2, 2, 110, 702, 3, 2, 2, 2, 112, 705, 3, 2, 2, 2, 114, 708, 3, 2, 2, 2, 116, 714, 3, 2, 2, 2, 118, 717, 3, 2, 2, 2, 120, 721, 3, 2, 2, 2, 122, 732, 3, 2, 2, 2, 124, 741, 3, 2, 2, 2, 126, 752, 3, 2, 2, 2, 128, 767, 3, 2, 2, 2, 130, 787, 3, 2, 2, 2, 132, 883, 3, 2, 2, 2, 134, 885, 3, 2, 2, 2, 136, 893, 3, 2, 2, 2, 138, 904, 3, 2, 2, 2, 140, 916, 3, 2, 2, 2, 142, 918, 3, 2, 2, 2, 144, 923, 3, 2, 2, 2, 146, 950, 3, 2, 2, 2, 148, 955, 3, 2, 2, 2, 150, 957, 3, 2, 2, 2, 152, 965, 3, 2, 2, 2, 154, 981, 3, 2, 2, 2, 156, 987, 3, 2, 2, 2, 158, 997, 3, 2, 2, 2, 160, 999, 3, 2, 2, 2, 162, 1007, 3, 2, 2, 2, 164, 1010, 3, 2, 2, 2, 166, 1013, 3, 2, 2, 2, 168, 1027, 3, 2, 2, 2, 170, 1029, 3, 2, 2, 2, 172, 1041, 3, 2, 2, 2, 174, 1044, 3, 2, 2, 2, 176, 1056, 3, 2, 2, 2, 178, 1064, 3, 2, 2, 2, 180, 1066, 3, 2, 2, 2, 182, 1096, 3, 2, 2, 2, 184, 1100, 3, 2, 2, 2, 186, 1102, 3, 2, 2, 2, 188, 1106, 3, 2, 2, 2, 190, 1109, 3, 2, 2, 2, 192, 1113, 3, 2, 2, 2, 194, 1128, 3, 2, 2, 2, 196, 206, 5, 4, 3, 2, 197, 206, 5, 18, 10, 2, 198, 206, 5, 22, 12, 2, 199, 206, 5, 56, 29, 2, 200, 206, 5, 38, 20, 2, 201, 206, 5, 44, 23, 2, 202, 206, 5, 30, 16, 2, 203, 206, 5, 32, 17, 2, 204, 206, 5, 34, 18, 2, 205, 196, 3, 2, 2, 2, 205, 197, 3, 2, 2, 2, 205, 198, 3, 2, 2, 2, 205, 199, 3, 2, 2, 2, 205, 200, 3, 2, 2, 2, 205, 201, 3, 2, 2, 2, 205, 202, 3, 2, 2, 2, 205, 203, 3, 2, 2, 2, 205, 204, 3, 2, 2, 2, 206, 209, 3, 2, 2, 2, 207, 205, 3, 2, 2, 2, 207, 208, 3, 2, 2, 2, 208, 210, 3, 2, 2, 2, 209, 207, 3, 2, 2, 2, 210, 211, 7, 2, 2, 3, 211, 3, 3, 2, 2, 2, 212, 213, 7, 3, 2, 2, 213, 214, 5, 6, 4, 2, 214, 215, 5, 8, 5, 2, 215, 216, 7, 4, 2, 2, 216, 5, 3, 2, 2, 2, 217, 218, 5, 188, 95, 2, 218, 7, 3, 2, 2, 2, 219, 222, 5, 10, 6, 2, 220, 222, 5, 130, 66, 2, 221, 219, 3, 2, 2, 2, 221, 220, 3, 2, 2, 2, 222, 9, 3, 2, 2, 2, 223, 230, 5, 14, 8, 2, 224, 226, 7, 5, 2, 2, 225, 224, 3, 2, 2, 2, 225, 226, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 229, 5, 14, 8, 2, 228, 225, 3, 2, 2, 2, 229, 232, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 11, 3, 2, 2, 2, 232, 230, 3, 2, 2, 2, 233, 234, 9, 2, 2, 2, 234, 13, 3, 2, 2, 2, 235, 237, 5, 12, 7, 2, 236, 235, 3, 2, 2, 2, 236, 237, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 238, 244, 7, 132, 2, 2, 239, 241, 5, 12, 7, 2, 240, 239, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 244, 7, 106, 2, 2, 243, 236, 3, 2, 2, 2, 243, 240, 3, 2, 2, 2, 244, 15, 3, 2, 2, 2, 245, 248, 5, 188, 95, 2, 246, 247, 7, 13, 2, 2, 247, 249, 5, 188, 95, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 17, 3, 2, 2, 2, 250, 251, 7, 14, 2, 2, 251, 254, 5, 20, 11, 2, 252, 253, 7, 13, 2, 2, 253, 255, 5, 188, 95, 2, 254, 252, 3, 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 256, 3, 2, 2, 2, 256, 257, 7, 4, 2, 2, 257, 287, 3, 2, 2, 2, 258, 261, 7, 14, 2, 2, 259, 262, 7, 15, 2, 2, 260, 262, 5, 188, 95, 2, 261, 259, 3, 2, 2, 2, 261, 260, 3, 2, 2, 2, 262, 265, 3, 2, 2, 2, 263, 264, 7, 13, 2, 2, 264, 266, 5, 188, 95, 2, 265, 263, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 268, 7, 16, 2, 2, 268, 269, 5, 20, 11, 2, 269, 270, 7, 4, 2, 2, 270, 287, 3, 2, 2, 2, 271, 272, 7, 14, 2, 2, 272, 273, 7, 17, 2, 2, 273, 278, 5, 16, 9, 2, 274, 275, 7, 18, 2, 2, 275, 277, 5, 16, 9, 2, 276, 274, 3, 2, 2, 2, 277, 280, 3, 2, 2, 2, 278, 276, 3, 2, 2, 2, 278, 279, 3, 2, 2, 2, 279, 281, 3, 2, 2, 2, 280, 278, 3, 2, 2, 2, 281, 282, 7, 19, 2, 2, 282, 283, 7, 16, 2, 2, 283, 284, 5, 20, 11, 2, 284, 285, 7, 4, 2, 2, 285, 287, 3, 2, 2, 2, 286, 250, 3, 2, 2, 2, 286, 258, 3, 2, 2, 2, 286, 271, 3, 2, 2, 2, 287, 19, 3, 2, 2, 2, 288, 289, 7, 131, 2, 2, 289, 21, 3, 2, 2, 2, 290, 292, 7, 20, 2, 2, 291, 290, 3, 2, 2, 2, 291, 292, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 294, 9, 3, 2, 2, 294, 304, 5, 188, 95, 2, 295, 296, 7, 24, 2, 2, 296, 301, 5, 24, 13, 2, 297, 298, 7, 18, 2, 2, 298, 300, 5, 24, 13, 2, 299, 297, 3, 2, 2, 2, 300, 303, 3, 2, 2, 2, 301, 299, 3, 2, 2, 2, 301, 302, 3, 2, 2, 2, 302, 305, 3, 2, 2, 2, 303, 301, 3, 2, 2, 2, 304, 295, 3, 2, 2, 2, 304, 305, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 310, 7, 17, 2, 2, 307, 309, 5, 26, 14, 2, 308, 307, 3, 2, 2, 2, 309, 312, 3, 2, 2, 2, 310, 308, 3, 2, 2, 2, 310, 311, 3, 2, 2, 2, 311, 313, 3, 2, 2, 2, 312, 310, 3, 2, 2, 2, 313, 314, 7, 19, 2, 2, 314, 23, 3, 2, 2, 2, 315, 321, 5, 74, 38, 2, 316, 318, 7, 25, 2, 2, 317, 319, 5, 134, 68, 2, 318, 317, 3, 2, 2, 2, 318, 319, 3, 2, 2, 2, 319, 320, 3, 2, 2, 2, 320, 322, 7, 26, 2, 2, 321, 316, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 25, 3, 2, 2, 2, 323, 333, 5, 28, 15, 2, 324, 333, 5, 36, 19, 2, 325, 333, 5, 38, 20, 2, 326, 333, 5, 40, 21, 2, 327, 333, 5, 44, 23, 2, 328, 333, 5, 52, 27, 2, 329, 333, 5, 56, 29, 2, 330, 333, 5, 32, 17, 2, 331, 333, 5, 34, 18, 2, 332, 323, 3, 2, 2, 2, 332, 324, 3, 2, 2, 2, 332, 325, 3, 2, 2, 2, 332, 326, 3, 2, 2, 2, 332, 327, 3, 2, 2, 2, 332, 328, 3, 2, 2, 2, 332, 329, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 331, 3, 2, 2, 2, 333, 27, 3, 2, 2, 2, 334, 343, 5, 72, 37, 2, 335, 342, 7, 122, 2, 2, 336, 342, 7, 119, 2, 2, 337, 342, 7, 121, 2, 2, 338, 342, 7, 113, 2, 2, 339, 342, 7, 114, 2, 2, 340, 342, 5, 192, 97, 2, 341, 335, 3, 2, 2, 2, 341, 336, 3, 2, 2, 2, 341, 337, 3, 2, 2, 2, 341, 338, 3, 2, 2, 2, 341, 339, 3, 2, 2, 2, 341, 340, 3, 2, 2, 2, 342, 345, 3, 2, 2, 2, 343, 341, 3, 2, 2, 2, 343, 344, 3, 2, 2, 2, 344, 346, 3, 2, 2, 2, 345, 343, 3, 2, 2, 2, 346, 349, 5, 188, 95, 2, 347, 348, 7, 12, 2, 2, 348, 350, 5, 130, 66, 2, 349, 347, 3, 2, 2, 2, 349, 350, 3, 2, 2, 2, 350, 351, 3, 2, 2, 2, 351, 352, 7, 4, 2, 2, 352, 29, 3, 2, 2, 2, 353, 354, 5, 72, 37, 2, 354, 355, 7, 113, 2, 2, 355, 356, 5, 188, 95, 2, 356, 357, 7, 12, 2, 2, 357, 358, 5, 130, 66, 2, 358, 359, 7, 4, 2, 2, 359, 31, 3, 2, 2, 2, 360, 361, 7, 27, 2, 2, 361, 362, 5, 188, 95, 2, 362, 363, 5, 58, 30, 2, 363, 364, 7, 4, 2, 2, 364, 33, 3, 2, 2, 2, 365, 366, 7, 125, 2, 2, 366, 367, 5, 188, 95, 2, 367, 368, 7, 24, 2, 2, 368, 369, 5, 128, 65, 2, 369, 370, 7, 4, 2, 2, 370, 35, 3, 2, 2, 2, 371, 372, 7, 28, 2, 2, 372, 373, 5, 188, 95, 2, 373, 376, 7, 29, 2, 2, 374, 377, 7, 15, 2, 2, 375, 377, 5, 72, 37, 2, 376, 374, 3, 2, 2, 2, 376, 375, 3, 2, 2, 2, 377, 378, 3, 2, 2, 2, 378, 379, 7, 4, 2, 2, 379, 37, 3, 2, 2, 2, 380, 381, 7, 30, 2, 2, 381, 382, 5, 188, 95, 2, 382, 393, 7, 17, 2, 2, 383, 384, 5, 70, 36, 2, 384, 390, 7, 4, 2, 2, 385, 386, 5, 70, 36, 2, 386, 387, 7, 4, 2, 2, 387, 389, 3, 2, 2, 2, 388, 385, 3, 2, 2, 2, 389, 392, 3, 2, 2, 2, 390, 388, 3, 2, 2, 2, 390, 391, 3, 2, 2, 2, 391, 394, 3, 2, 2, 2, 392, 390, 3, 2, 2, 2, 393, 383, 3, 2, 2, 2, 393, 394, 3, 2, 2, 2, 394, 395, 3, 2, 2, 2, 395, 396, 7, 19, 2, 2, 396, 39, 3, 2, 2, 2, 397, 398, 7, 31, 2, 2, 398, 400, 5, 188, 95, 2, 399, 401, 5, 58, 30, 2, 400, 399, 3, 2, 2, 2, 400, 401, 3, 2, 2, 2, 401, 406, 3, 2, 2, 2, 402, 405, 7, 123, 2, 2, 403, 405, 5, 192, 97, 2, 404, 402, 3, 2, 2, 2, 404, 403, 3, 2, 2, 2, 405, 408, 3, 2, 2, 2, 406, 404, 3, 2, 2, 2, 406, 407, 3, 2, 2, 2, 407, 411, 3, 2, 2, 2, 408, 406, 3, 2, 2, 2, 409, 412, 7, 4, 2, 2, 410, 412, 5, 86, 44, 2, 411, 409, 3, 2, 2, 2, 411, 410, 3, 2, 2, 2, 412, 41, 3, 2, 2, 2, 413, 419, 5, 188, 95, 2, 414, 416, 7, 25, 2, 2, 415, 417, 5, 134, 68, 2, 416, 415, 3, 2, 2, 2, 416, 417, 3, 2, 2, 2, 417, 418, 3, 2, 2, 2, 418, 420, 7, 26, 2, 2, 419, 414, 3, 2, 2, 2, 419, 420, 3, 2, 2, 2, 420, 43, 3, 2, 2, 2, 421, 422, 5, 46, 24, 2, 422, 423, 5, 58, 30, 2, 423, 425, 5, 50, 26, 2, 424, 426, 5, 48, 25, 2, 425, 424, 3, 2, 2, 2, 425, 426, 3, 2, 2, 2, 426, 429, 3, 2, 2, 2, 427, 430, 7, 4, 2, 2, 428, 430, 5, 86, 44, 2, 429, 427, 3, 2, 2, 2, 429, 428, 3, 2, 2, 2, 430, 45, 3, 2, 2, 2, 431, 433, 7, 32, 2, 2, 432, 434, 5, 188, 95, 2, 433, 432, 3, 2, 2, 2, 433, 434, 3, 2, 2, 2, 434, 439, 3, 2, 2, 2, 435, 439, 7, 127, 2, 2, 436, 439, 7, 128, 2, 2, 437, 439, 7, 129, 2, 2, 438, 431, 3, 2, 2, 2, 438, 435, 3, 2, 2, 2, 438, 436, 3, 2, 2, 2, 438, 437, 3, 2, 2, 2, 439, 47, 3, 2, 2, 2, 440, 441, 7, 33, 2, 2, 441, 442, 5, 58, 30, 2, 442, 49, 3, 2, 2, 2, 443, 452, 7, 117, 2, 2, 444, 452, 7, 122, 2, 2, 445, 452, 7, 119, 2, 2, 446, 452, 7, 121, 2, 2, 447, 452, 7, 123, 2, 2, 448, 452, 5, 84, 43, 2, 449, 452, 5, 42, 22, 2, 450, 452, 5, 192, 97, 2, 451, 443, 3, 2, 2, 2, 451, 444, 3, 2, 2, 2, 451, 445, 3, 2, 2, 2, 451, 446, 3, 2, 2, 2, 451, 447, 3, 2, 2, 2, 451, 448, 3, 2, 2, 2, 451, 449, 3, 2, 2, 2, 451, 450, 3, 2, 2, 2, 452, 455, 3, 2, 2, 2, 453, 451, 3, 2, 2, 2, 453, 454, 3, 2, 2, 2, 454, 51, 3, 2, 2, 2, 455, 453, 3, 2, 2, 2, 456, 457, 7, 34, 2, 2, 457, 458, 5, 188, 95, 2, 458, 460, 5, 62, 32, 2, 459, 461, 7, 111, 2, 2, 460, 459, 3, 2, 2, 2, 460, 461, 3, 2, 2, 2, 461, 462, 3, 2, 2, 2, 462, 463, 7, 4, 2, 2, 463, 53, 3, 2, 2, 2, 464, 465, 5, 188, 95, 2, 465, 55, 3, 2, 2, 2, 466, 467, 7, 35, 2, 2, 467, 468, 5, 188, 95, 2, 468, 470, 7, 17, 2, 2, 469, 471, 5, 54, 28, 2, 470, 469, 3, 2, 2, 2, 470, 471, 3, 2, 2, 2, 471, 476, 3, 2, 2, 2, 472, 473, 7, 18, 2, 2, 473, 475, 5, 54, 28, 2, 474, 472, 3, 2, 2, 2, 475, 478, 3, 2, 2, 2, 476, 474, 3, 2, 2, 2, 476, 477, 3, 2, 2, 2, 477, 479, 3, 2, 2, 2, 478, 476, 3, 2, 2, 2, 479, 480, 7, 19, 2, 2, 480, 57, 3, 2, 2, 2, 481, 490, 7, 25, 2, 2, 482, 487, 5, 60, 31, 2, 483, 484, 7, 18, 2, 2, 484, 486, 5, 60, 31, 2, 485, 483, 3, 2, 2, 2, 486, 489, 3, 2, 2, 2, 487, 485, 3, 2, 2, 2, 487, 488, 3, 2, 2, 2, 488, 491, 3, 2, 2, 2, 489, 487, 3, 2, 2, 2, 490, 482, 3, 2, 2, 2, 490, 491, 3, 2, 2, 2, 491, 492, 3, 2, 2, 2, 492, 493, 7, 26, 2, 2, 493, 59, 3, 2, 2, 2, 494, 496, 5, 72, 37, 2, 495, 497, 5, 82, 42, 2, 496, 495, 3, 2, 2, 2, 496, 497, 3, 2, 2, 2, 497, 499, 3, 2, 2, 2, 498, 500, 5, 188, 95, 2, 499, 498, 3, 2, 2, 2, 499, 500, 3, 2, 2, 2, 500, 61, 3, 2, 2, 2, 501, 510, 7, 25, 2, 2, 502, 507, 5, 64, 33, 2, 503, 504, 7, 18, 2, 2, 504, 506, 5, 64, 33, 2, 505, 503, 3, 2, 2, 2, 506, 509, 3, 2, 2, 2, 507, 505, 3, 2, 2, 2, 507, 508, 3, 2, 2, 2, 508, 511, 3, 2, 2, 2, 509, 507, 3, 2, 2, 2, 510, 502, 3, 2, 2, 2, 510, 511, 3, 2, 2, 2, 511, 512, 3, 2, 2, 2, 512, 513, 7, 26, 2, 2, 513, 63, 3, 2, 2, 2, 514, 516, 5, 72, 37, 2, 515, 517, 7, 118, 2, 2, 516, 515, 3, 2, 2, 2, 516, 517, 3, 2, 2, 2, 517, 519, 3, 2, 2, 2, 518, 520, 5, 188, 95, 2, 519, 518, 3, 2, 2, 2, 519, 520, 3, 2, 2, 2, 520, 65, 3, 2, 2, 2, 521, 530, 7, 25, 2, 2, 522, 527, 5, 68, 35, 2, 523, 524, 7, 18, 2, 2, 524, 526, 5, 68, 35, 2, 525, 523, 3, 2, 2, 2, 526, 529, 3, 2, 2, 2, 527, 525, 3, 2, 2, 2, 527, 528, 3, 2, 2, 2, 528, 531, 3, 2, 2, 2, 529, 527, 3, 2, 2, 2, 530, 522, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 532, 3, 2, 2, 2, 532, 533, 7, 26, 2, 2, 533, 67, 3, 2, 2, 2, 534, 536, 5, 72, 37, 2, 535, 537, 5, 82, 42, 2, 536, 535, 3, 2, 2, 2, 536, 537, 3, 2, 2, 2, 537, 69, 3, 2, 2, 2, 538, 540, 5, 72, 37, 2, 539, 541, 5, 82, 42, 2, 540, 539, 3, 2, 2, 2, 540, 541, 3, 2, 2, 2, 541, 542, 3, 2, 2, 2, 542, 543, 5, 188, 95, 2, 543, 71, 3, 2, 2, 2, 544, 545, 8, 37, 1, 2, 545, 552, 5, 128, 65, 2, 546, 552, 5, 74, 38, 2, 547, 552, 5, 78, 40, 2, 548, 552, 5, 80, 41, 2, 549, 550, 7, 38, 2, 2, 550, 552, 7, 120, 2, 2, 551, 544, 3, 2, 2, 2, 551, 546, 3, 2, 2, 2, 551, 547, 3, 2, 2, 2, 551, 548, 3, 2, 2, 2, 551, 549, 3, 2, 2, 2, 552, 561, 3, 2, 2, 2, 553, 554, 12, 5, 2, 2, 554, 556, 7, 36, 2, 2, 555, 557, 5, 130, 66, 2, 556, 555, 3, 2, 2, 2, 556, 557, 3, 2, 2, 2, 557, 558, 3, 2, 2, 2, 558, 560, 7, 37, 2, 2, 559, 553, 3, 2, 2, 2, 560, 563, 3, 2, 2, 2, 561, 559, 3, 2, 2, 2, 561, 562, 3, 2, 2, 2, 562, 73, 3, 2, 2, 2, 563, 561, 3, 2, 2, 2, 564, 569, 5, 188, 95, 2, 565, 566, 7, 39, 2, 2, 566, 568, 5, 188, 95, 2, 567, 565, 3, 2, 2, 2, 568, 571, 3, 2, 2, 2, 569, 567, 3, 2, 2, 2, 569, 570, 3, 2, 2, 2, 570, 75, 3, 2, 2, 2, 571, 569, 3, 2, 2, 2, 572, 575, 5, 128, 65, 2, 573, 575, 5, 74, 38, 2, 574, 572, 3, 2, 2, 2, 574, 573, 3, 2, 2, 2, 575, 77, 3, 2, 2, 2, 576, 577, 7, 40, 2, 2, 577, 578, 7, 25, 2, 2, 578, 579, 5, 76, 39, 2, 579, 580, 7, 41, 2, 2, 580, 581, 5, 72, 37, 2, 581, 582, 7, 26, 2, 2, 582, 79, 3, 2, 2, 2, 583, 584, 7, 32, 2, 2, 584, 590, 5, 66, 34, 2, 585, 589, 7, 119, 2, 2, 586, 589, 7, 117, 2, 2, 587, 589, 5, 84, 43, 2, 588, 585, 3, 2, 2, 2, 588, 586, 3, 2, 2, 2, 588, 587, 3, 2, 2, 2, 589, 592, 3, 2, 2, 2, 590, 588, 3, 2, 2, 2, 590, 591, 3, 2, 2, 2, 591, 595, 3, 2, 2, 2, 592, 590, 3, 2, 2, 2, 593, 594, 7, 33, 2, 2, 594, 596, 5, 66, 34, 2, 595, 593, 3, 2, 2, 2, 595, 596, 3, 2, 2, 2, 596, 81, 3, 2, 2, 2, 597, 598, 9, 4, 2, 2, 598, 83, 3, 2, 2, 2, 599, 600, 9, 5, 2, 2, 600, 85, 3, 2, 2, 2, 601, 605, 7, 17, 2, 2, 602, 604, 5, 88, 45, 2, 603, 602, 3, 2, 2, 2, 604, 607, 3, 2, 2, 2, 605, 603, 3, 2, 2, 2, 605, 606, 3, 2, 2, 2, 606, 608, 3, 2, 2, 2, 607, 605, 3, 2, 2, 2, 608, 609, 7, 19, 2, 2, 609, 87, 3, 2, 2, 2, 610, 626, 5, 92, 47, 2, 611, 626, 5, 94, 48, 2, 612, 626, 5, 98, 50, 2, 613, 626, 5, 104, 53, 2, 614, 626, 5, 86, 44, 2, 615, 626, 5, 106, 54, 2, 616, 626, 5, 108, 55, 2, 617, 626, 5, 110, 56, 2, 618, 626, 5, 112, 57, 2, 619, 626, 5, 114, 58, 2, 620, 626, 5, 116, 59, 2, 621, 626, 5, 118, 60, 2, 622, 626, 5, 100, 51, 2, 623, 626, 5, 102, 52, 2, 624, 626, 5, 120, 61, 2, 625, 610, 3, 2, 2, 2, 625, 611, 3, 2, 2, 2, 625, 612, 3, 2, 2, 2, 625, 613, 3, 2, 2, 2, 625, 614, 3, 2, 2, 2, 625, 615, 3, 2, 2, 2, 625, 616, 3, 2, 2, 2, 625, 617, 3, 2, 2, 2, 625, 618, 3, 2, 2, 2, 625, 619, 3, 2, 2, 2, 625, 620, 3, 2, 2, 2, 625, 621, 3, 2, 2, 2, 625, 622, 3, 2, 2, 2, 625, 623, 3, 2, 2, 2, 625, 624, 3, 2, 2, 2, 626, 89, 3, 2, 2, 2, 627, 628, 5, 130, 66, 2, 628, 629, 7, 4, 2, 2, 629, 91, 3, 2, 2, 2, 630, 631, 7, 45, 2, 2, 631, 632, 7, 25, 2, 2, 632, 633, 5, 130, 66, 2, 633, 634, 7, 26, 2, 2, 634, 637, 5, 88, 45, 2, 635, 636, 7, 46, 2, 2, 636, 638, 5, 88, 45, 2, 637, 635, 3, 2, 2, 2, 637, 638, 3, 2, 2, 2, 638, 93, 3, 2, 2, 2, 639, 640, 7, 47, 2, 2, 640, 642, 5, 130, 66, 2, 641, 643, 5, 48, 25, 2, 642, 641, 3, 2, 2, 2, 642, 643, 3, 2, 2, 2, 643, 644, 3, 2, 2, 2, 644, 646, 5, 86, 44, 2, 645, 647, 5, 96, 49, 2, 646, 645, 3, 2, 2, 2, 647, 648, 3, 2, 2, 2, 648, 646, 3, 2, 2, 2, 648, 649, 3, 2, 2, 2, 649, 95, 3, 2, 2, 2, 650, 655, 7, 48, 2, 2, 651, 653, 5, 188, 95, 2, 652, 651, 3, 2, 2, 2, 652, 653, 3, 2, 2, 2, 653, 654, 3, 2, 2, 2, 654, 656, 5, 58, 30, 2, 655, 652, 3, 2, 2, 2, 655, 656, 3, 2, 2, 2, 656, 657, 3, 2, 2, 2, 657, 658, 5, 86, 44, 2, 658, 97, 3, 2, 2, 2, 659, 660, 7, 49, 2, 2, 660, 661, 7, 25, 2, 2, 661, 662, 5, 130, 66, 2, 662, 663, 7, 26, 2, 2, 663, 664, 5, 88, 45, 2, 664, 99, 3, 2, 2, 2, 665, 668, 5, 122, 62, 2, 666, 668, 5, 90, 46, 2, 667, 665, 3, 2, 2, 2, 667, 666, 3, 2, 2, 2, 668, 101, 3, 2, 2, 2, 669, 670, 7, 50, 2, 2, 670, 671, 5, 86, 44, 2, 671, 103, 3, 2, 2, 2, 672, 673, 7, 29, 2, 2, 673, 676, 7, 25, 2, 2, 674, 677, 5, 100, 51, 2, 675, 677, 7, 4, 2, 2, 676, 674, 3, 2, 2, 2, 676, 675, 3, 2, 2, 2, 677, 680, 3, 2, 2, 2, 678, 681, 5, 90, 46, 2, 679, 681, 7, 4, 2, 2, 680, 678, 3, 2, 2, 2, 680, 679, 3, 2, 2, 2, 681, 683, 3, 2, 2, 2, 682, 684, 5, 130, 66, 2, 683, 682, 3, 2, 2, 2, 683, 684, 3, 2, 2, 2, 684, 685, 3, 2, 2, 2, 685, 686, 7, 26, 2, 2, 686, 687, 5, 88, 45, 2, 687, 105, 3, 2, 2, 2, 688, 690, 7, 51, 2, 2, 689, 691, 7, 131, 2, 2, 690, 689, 3, 2, 2, 2, 690, 691, 3, 2, 2, 2, 691, 692, 3, 2, 2, 2, 692, 693, 5, 144, 73, 2, 693, 107, 3, 2, 2, 2, 694, 695, 7, 52, 2, 2, 695, 696, 5, 88, 45, 2, 696, 697, 7, 49, 2, 2, 697, 698, 7, 25, 2, 2, 698, 699, 5, 130, 66, 2, 699, 700, 7, 26, 2, 2, 700, 701, 7, 4, 2, 2, 701, 109, 3, 2, 2, 2, 702, 703, 7, 115, 2, 2, 703, 704, 7, 4, 2, 2, 704, 111, 3, 2, 2, 2, 705, 706, 7, 112, 2, 2, 706, 707, 7, 4, 2, 2, 707, 113, 3, 2, 2, 2, 708, 710, 7, 53, 2, 2, 709, 711, 5, 130, 66, 2, 710, 709, 3, 2, 2, 2, 710, 711, 3, 2, 2, 2, 711, 712, 3, 2, 2, 2, 712, 713, 7, 4, 2, 2, 713, 115, 3, 2, 2, 2, 714, 715, 7, 54, 2, 2, 715, 716, 7, 4, 2, 2, 716, 117, 3, 2, 2, 2, 717, 718, 7, 55, 2, 2, 718, 719, 5, 142, 72, 2, 719, 720, 7, 4, 2, 2, 720, 119, 3, 2, 2, 2, 721, 722, 7, 56, 2, 2, 722, 723, 5, 142, 72, 2, 723, 724, 7, 4, 2, 2, 724, 121, 3, 2, 2, 2, 725, 726, 7, 57, 2, 2, 726, 733, 5, 126, 64, 2, 727, 733, 5, 70, 36, 2, 728, 729, 7, 25, 2, 2, 729, 730, 5, 124, 63, 2, 730, 731, 7, 26, 2, 2, 731, 733, 3, 2, 2, 2, 732, 725, 3, 2, 2, 2, 732, 727, 3, 2, 2, 2, 732, 728, 3, 2, 2, 2, 733, 736, 3, 2, 2, 2, 734, 735, 7, 12, 2, 2, 735, 737, 5, 130, 66, 2, 736, 734, 3, 2, 2, 2, 736, 737, 3, 2, 2, 2, 737, 738, 3, 2, 2, 2, 738, 739, 7, 4, 2, 2, 739, 123, 3, 2, 2, 2, 740, 742, 5, 70, 36, 2, 741, 740, 3, 2, 2, 2, 741, 742, 3, 2, 2, 2, 742, 749, 3, 2, 2, 2, 743, 745, 7, 18, 2, 2, 744, 746, 5, 70, 36, 2, 745, 744, 3, 2, 2, 2, 745, 746, 3, 2, 2, 2, 746, 748, 3, 2, 2, 2, 747, 743, 3, 2, 2, 2, 748, 751, 3, 2, 2, 2, 749, 747, 3, 2, 2, 2, 749, 750, 3, 2, 2, 2, 750, 125, 3, 2, 2, 2, 751, 749, 3, 2, 2, 2, 752, 759, 7, 25, 2, 2, 753, 755, 5, 188, 95, 2, 754, 753, 3, 2, 2, 2, 754, 755, 3, 2, 2, 2, 755, 756, 3, 2, 2, 2, 756, 758, 7, 18, 2, 2, 757, 754, 3, 2, 2, 2, 758, 761, 3, 2, 2, 2, 759, 757, 3, 2, 2, 2, 759, 760, 3, 2, 2, 2, 760, 763, 3, 2, 2, 2, 761, 759, 3, 2, 2, 2, 762, 764, 5, 188, 95, 2, 763, 762, 3, 2, 2, 2, 763, 764, 3, 2, 2, 2, 764, 765, 3, 2, 2, 2, 765, 766, 7, 26, 2, 2, 766, 127, 3, 2, 2, 2, 767, 768, 9, 6, 2, 2, 768, 129, 3, 2, 2, 2, 769, 770, 8, 66, 1, 2, 770, 771, 7, 63, 2, 2, 771, 788, 5, 72, 37, 2, 772, 773, 7, 25, 2, 2, 773, 774, 5, 130, 66, 2, 774, 775, 7, 26, 2, 2, 775, 788, 3, 2, 2, 2, 776, 777, 9, 7, 2, 2, 777, 788, 5, 130, 66, 21, 778, 779, 9, 8, 2, 2, 779, 788, 5, 130, 66, 20, 780, 781, 9, 9, 2, 2, 781, 788, 5, 130, 66, 19, 782, 783, 7, 69, 2, 2, 783, 788, 5, 130, 66, 18, 784, 785, 7, 7, 2, 2, 785, 788, 5, 130, 66, 17, 786, 788, 5, 132, 67, 2, 787, 769, 3, 2, 2, 2, 787, 772, 3, 2, 2, 2, 787, 776, 3, 2, 2, 2, 787, 778, 3, 2, 2, 2, 787, 780, 3, 2, 2, 2, 787, 782, 3, 2, 2, 2, 787, 784, 3, 2, 2, 2, 787, 786, 3, 2, 2, 2, 788, 863, 3, 2, 2, 2, 789, 790, 12, 16, 2, 2, 790, 791, 7, 70, 2, 2, 791, 862, 5, 130, 66, 17, 792, 793, 12, 15, 2, 2, 793, 794, 9, 10, 2, 2, 794, 862, 5, 130, 66, 16, 795, 796, 12, 14, 2, 2, 796, 797, 9, 8, 2, 2, 797, 862, 5, 130, 66, 15, 798, 799, 12, 13, 2, 2, 799, 800, 9, 11, 2, 2, 800, 862, 5, 130, 66, 14, 801, 802, 12, 12, 2, 2, 802, 803, 7, 75, 2, 2, 803, 862, 5, 130, 66, 13, 804, 805, 12, 11, 2, 2, 805, 806, 7, 6, 2, 2, 806, 862, 5, 130, 66, 12, 807, 808, 12, 10, 2, 2, 808, 809, 7, 76, 2, 2, 809, 862, 5, 130, 66, 11, 810, 811, 12, 9, 2, 2, 811, 812, 9, 12, 2, 2, 812, 862, 5, 130, 66, 10, 813, 814, 12, 8, 2, 2, 814, 815, 9, 13, 2, 2, 815, 862, 5, 130, 66, 9, 816, 817, 12, 7, 2, 2, 817, 818, 7, 79, 2, 2, 818, 862, 5, 130, 66, 8, 819, 820, 12, 6, 2, 2, 820, 821, 7, 5, 2, 2, 821, 862, 5, 130, 66, 7, 822, 823, 12, 5, 2, 2, 823, 824, 7, 80, 2, 2, 824, 825, 5, 130, 66, 2, 825, 826, 7, 64, 2, 2, 826, 827, 5, 130, 66, 6, 827, 862, 3, 2, 2, 2, 828, 829, 12, 4, 2, 2, 829, 830, 9, 14, 2, 2, 830, 862, 5, 130, 66, 5, 831, 832, 12, 29, 2, 2, 832, 862, 9, 7, 2, 2, 833, 834, 12, 27, 2, 2, 834, 835, 7, 36, 2, 2, 835, 836, 5, 130, 66, 2, 836, 837, 7, 37, 2, 2, 837, 862, 3, 2, 2, 2, 838, 839, 12, 26, 2, 2, 839, 841, 7, 36, 2, 2, 840, 842, 5, 130, 66, 2, 841, 840, 3, 2, 2, 2, 841, 842, 3, 2, 2, 2, 842, 843, 3, 2, 2, 2, 843, 845, 7, 64, 2, 2, 844, 846, 5, 130, 66, 2, 845, 844, 3, 2, 2, 2, 845, 846, 3, 2, 2, 2, 846, 847, 3, 2, 2, 2, 847, 862, 7, 37, 2, 2, 848, 849, 12, 25, 2, 2, 849, 850, 7, 39, 2, 2, 850, 862, 5, 188, 95, 2, 851, 852, 12, 24, 2, 2, 852, 853, 7, 17, 2, 2, 853, 854, 5, 136, 69, 2, 854, 855, 7, 19, 2, 2, 855, 862, 3, 2, 2, 2, 856, 857, 12, 23, 2, 2, 857, 858, 7, 25, 2, 2, 858, 859, 5, 140, 71, 2, 859, 860, 7, 26, 2, 2, 860, 862, 3, 2, 2, 2, 861, 789, 3, 2, 2, 2, 861, 792, 3, 2, 2, 2, 861, 795, 3, 2, 2, 2, 861, 798, 3, 2, 2, 2, 861, 801, 3, 2, 2, 2, 861, 804, 3, 2, 2, 2, 861, 807, 3, 2, 2, 2, 861, 810, 3, 2, 2, 2, 861, 813, 3, 2, 2, 2, 861, 816, 3, 2, 2, 2, 861, 819, 3, 2, 2, 2, 861, 822, 3, 2, 2, 2, 861, 828, 3, 2, 2, 2, 861, 831, 3, 2, 2, 2, 861, 833, 3, 2, 2, 2, 861, 838, 3, 2, 2, 2, 861, 848, 3, 2, 2, 2, 861, 851, 3, 2, 2, 2, 861, 856, 3, 2, 2, 2, 862, 865, 3, 2, 2, 2, 863, 861, 3, 2, 2, 2, 863, 864, 3, 2, 2, 2, 864, 131, 3, 2, 2, 2, 865, 863, 3, 2, 2, 2, 866, 884, 7, 105, 2, 2, 867, 884, 5, 186, 94, 2, 868, 884, 5, 190, 96, 2, 869, 884, 5, 194, 98, 2, 870, 873, 5, 188, 95, 2, 871, 872, 7, 36, 2, 2, 872, 874, 7, 37, 2, 2, 873, 871, 3, 2, 2, 2, 873, 874, 3, 2, 2, 2, 874, 884, 3, 2, 2, 2, 875, 884, 7, 125, 2, 2, 876, 884, 7, 120, 2, 2, 877, 884, 5, 182, 92, 2, 878, 881, 5, 184, 93, 2, 879, 880, 7, 36, 2, 2, 880, 882, 7, 37, 2, 2, 881, 879, 3, 2, 2, 2, 881, 882, 3, 2, 2, 2, 882, 884, 3, 2, 2, 2, 883, 866, 3, 2, 2, 2, 883, 867, 3, 2, 2, 2, 883, 868, 3, 2, 2, 2, 883, 869, 3, 2, 2, 2, 883, 870, 3, 2, 2, 2, 883, 875, 3, 2, 2, 2, 883, 876, 3, 2, 2, 2, 883, 877, 3, 2, 2, 2, 883, 878, 3, 2, 2, 2, 884, 133, 3, 2, 2, 2, 885, 890, 5, 130, 66, 2, 886, 887, 7, 18, 2, 2, 887, 889, 5, 130, 66, 2, 888, 886, 3, 2, 2, 2, 889, 892, 3, 2, 2, 2, 890, 888, 3, 2, 2, 2, 890, 891, 3, 2, 2, 2, 891, 135, 3, 2, 2, 2, 892, 890, 3, 2, 2, 2, 893, 898, 5, 138, 70, 2, 894, 895, 7, 18, 2, 2, 895, 897, 5, 138, 70, 2, 896, 894, 3, 2, 2, 2, 897, 900, 3, 2, 2, 2, 898, 896, 3, 2, 2, 2, 898, 899, 3, 2, 2, 2, 899, 902, 3, 2, 2, 2, 900, 898, 3, 2, 2, 2, 901, 903, 7, 18, 2, 2, 902, 901, 3, 2, 2, 2, 902, 903, 3, 2, 2, 2, 903, 137, 3, 2, 2, 2, 904, 905, 5, 188, 95, 2, 905, 906, 7, 64, 2, 2, 906, 907, 5, 130, 66, 2, 907, 139, 3, 2, 2, 2, 908, 910, 7, 17, 2, 2, 909, 911, 5, 136, 69, 2, 910, 909, 3, 2, 2, 2, 910, 911, 3, 2, 2, 2, 911, 912, 3, 2, 2, 2, 912, 917, 7, 19, 2, 2, 913, 915, 5, 134, 68, 2, 914, 913, 3, 2, 2, 2, 914, 915, 3, 2, 2, 2, 915, 917, 3, 2, 2, 2, 916, 908, 3, 2, 2, 2, 916, 914, 3, 2, 2, 2, 917, 141, 3, 2, 2, 2, 918, 919, 5, 130, 66, 2, 919, 920, 7, 25, 2, 2, 920, 921, 5, 140, 71, 2, 921, 922, 7, 26, 2, 2, 922, 143, 3, 2, 2, 2, 923, 927, 7, 17, 2, 2, 924, 926, 5, 146, 74, 2, 925, 924, 3, 2, 2, 2, 926, 929, 3, 2, 2, 2, 927, 925, 3, 2, 2, 2, 927, 928, 3, 2, 2, 2, 928, 930, 3, 2, 2, 2, 929, 927, 3, 2, 2, 2, 930, 931, 7, 19, 2, 2, 931, 145, 3, 2, 2, 2, 932, 951, 5, 188, 95, 2, 933, 951, 5, 144, 73, 2, 934, 951, 5, 148, 75, 2, 935, 951, 5, 154, 78, 2, 936, 951, 5, 156, 79, 2, 937, 951, 5, 162, 82, 2, 938, 951, 5, 164, 83, 2, 939, 951, 5, 166, 84, 2, 940, 951, 5, 170, 86, 2, 941, 951, 5, 174, 88, 2, 942, 951, 5, 176, 89, 2, 943, 951, 7, 112, 2, 2, 944, 951, 7, 115, 2, 2, 945, 951, 7, 116, 2, 2, 946, 951, 5, 180, 91, 2, 947, 951, 5, 186, 94, 2, 948, 951, 5, 194, 98, 2, 949, 951, 5, 190, 96, 2, 950, 932, 3, 2, 2, 2, 950, 933, 3, 2, 2, 2, 950, 934, 3, 2, 2, 2, 950, 935, 3, 2, 2, 2, 950, 936, 3, 2, 2, 2, 950, 937, 3, 2, 2, 2, 950, 938, 3, 2, 2, 2, 950, 939, 3, 2, 2, 2, 950, 940, 3, 2, 2, 2, 950, 941, 3, 2, 2, 2, 950, 942, 3, 2, 2, 2, 950, 943, 3, 2, 2, 2, 950, 944, 3, 2, 2, 2, 950, 945, 3, 2, 2, 2, 950, 946, 3, 2, 2, 2, 950, 947, 3, 2, 2, 2, 950, 948, 3, 2, 2, 2, 950, 949, 3, 2, 2, 2, 951, 147, 3, 2, 2, 2, 952, 956, 5, 152, 77, 2, 953, 956, 5, 178, 90, 2, 954, 956, 5, 150, 76, 2, 955, 952, 3, 2, 2, 2, 955, 953, 3, 2, 2, 2, 955, 954, 3, 2, 2, 2, 956, 149, 3, 2, 2, 2, 957, 958, 5, 188, 95, 2, 958, 959, 7, 39, 2, 2, 959, 960, 5, 188, 95, 2, 960, 151, 3, 2, 2, 2, 961, 966, 7, 53, 2, 2, 962, 966, 7, 38, 2, 2, 963, 966, 7, 60, 2, 2, 964, 966, 5, 188, 95, 2, 965, 961, 3, 2, 2, 2, 965, 962, 3, 2, 2, 2, 965, 963, 3, 2, 2, 2, 965, 964, 3, 2, 2, 2, 966, 979, 3, 2, 2, 2, 967, 969, 7, 25, 2, 2, 968, 970, 5, 148, 75, 2, 969, 968, 3, 2, 2, 2, 969, 970, 3, 2, 2, 2, 970, 975, 3, 2, 2, 2, 971, 972, 7, 18, 2, 2, 972, 974, 5, 148, 75, 2, 973, 971, 3, 2, 2, 2, 974, 977, 3, 2, 2, 2, 975, 973, 3, 2, 2, 2, 975, 976, 3, 2, 2, 2, 976, 978, 3, 2, 2, 2, 977, 975, 3, 2, 2, 2, 978, 980, 7, 26, 2, 2, 979, 967, 3, 2, 2, 2, 979, 980, 3, 2, 2, 2, 980, 153, 3, 2, 2, 2, 981, 982, 7, 91, 2, 2, 982, 985, 5, 158, 80, 2, 983, 984, 7, 92, 2, 2, 984, 986, 5, 148, 75, 2, 985, 983, 3, 2, 2, 2, 985, 986, 3, 2, 2, 2, 986, 155, 3, 2, 2, 2, 987, 988, 5, 158, 80, 2, 988, 989, 7, 92, 2, 2, 989, 990, 5, 148, 75, 2, 990, 157, 3, 2, 2, 2, 991, 998, 5, 188, 95, 2, 992, 998, 5, 150, 76, 2, 993, 994, 7, 25, 2, 2, 994, 995, 5, 160, 81, 2, 995, 996, 7, 26, 2, 2, 996, 998, 3, 2, 2, 2, 997, 991, 3, 2, 2, 2, 997, 992, 3, 2, 2, 2, 997, 993, 3, 2, 2, 2, 998, 159, 3, 2, 2, 2, 999, 1004, 5, 188, 95, 2, 1000, 1001, 7, 18, 2, 2, 1001, 1003, 5, 188, 95, 2, 1002, 1000, 3, 2, 2, 2, 1003, 1006, 3, 2, 2, 2, 1004, 1002, 3, 2, 2, 2, 1004, 1005, 3, 2, 2, 2, 1005, 161, 3, 2, 2, 2, 1006, 1004, 3, 2, 2, 2, 1007, 1008, 7, 93, 2, 2, 1008, 1009, 5, 188, 95, 2, 1009, 163, 3, 2, 2, 2, 1010, 1011, 5, 188, 95, 2, 1011, 1012, 7, 64, 2, 2, 1012, 165, 3, 2, 2, 2, 1013, 1014, 7, 94, 2, 2, 1014, 1018, 5, 148, 75, 2, 1015, 1017, 5, 168, 85, 2, 1016, 1015, 3, 2, 2, 2, 1017, 1020, 3, 2, 2, 2, 1018, 1016, 3, 2, 2, 2, 1018, 1019, 3, 2, 2, 2, 1019, 167, 3, 2, 2, 2, 1020, 1018, 3, 2, 2, 2, 1021, 1022, 7, 95, 2, 2, 1022, 1023, 5, 178, 90, 2, 1023, 1024, 5, 144, 73, 2, 1024, 1028, 3, 2, 2, 2, 1025, 1026, 7, 96, 2, 2, 1026, 1028, 5, 144, 73, 2, 1027, 1021, 3, 2, 2, 2, 1027, 1025, 3, 2, 2, 2, 1028, 169, 3, 2, 2, 2, 1029, 1030, 7, 32, 2, 2, 1030, 1031, 5, 188, 95, 2, 1031, 1033, 7, 25, 2, 2, 1032, 1034, 5, 160, 81, 2, 1033, 1032, 3, 2, 2, 2, 1033, 1034, 3, 2, 2, 2, 1034, 1035, 3, 2, 2, 2, 1035, 1037, 7, 26, 2, 2, 1036, 1038, 5, 172, 87, 2, 1037, 1036, 3, 2, 2, 2, 1037, 1038, 3, 2, 2, 2, 1038, 1039, 3, 2, 2, 2, 1039, 1040, 5, 144, 73, 2, 1040, 171, 3, 2, 2, 2, 1041, 1042, 7, 97, 2, 2, 1042, 1043, 5, 160, 81, 2, 1043, 173, 3, 2, 2, 2, 1044, 1047, 7, 29, 2, 2, 1045, 1048, 5, 144, 73, 2, 1046, 1048, 5, 148, 75, 2, 1047, 1045, 3, 2, 2, 2, 1047, 1046, 3, 2, 2, 2, 1048, 1049, 3, 2, 2, 2, 1049, 1052, 5, 148, 75, 2, 1050, 1053, 5, 144, 73, 2, 1051, 1053, 5, 148, 75, 2, 1052, 1050, 3, 2, 2, 2, 1052, 1051, 3, 2, 2, 2, 1053, 1054, 3, 2, 2, 2, 1054, 1055, 5, 144, 73, 2, 1055, 175, 3, 2, 2, 2, 1056, 1057, 7, 45, 2, 2, 1057, 1058, 5, 148, 75, 2, 1058, 1059, 5, 144, 73, 2, 1059, 177, 3, 2, 2, 2, 1060, 1065, 5, 194, 98, 2, 1061, 1065, 7, 106, 2, 2, 1062, 1065, 7, 107, 2, 2, 1063, 1065, 5, 190, 96, 2, 1064, 1060, 3, 2, 2, 2, 1064, 1061, 3, 2, 2, 2, 1064, 1062, 3, 2, 2, 2, 1064, 1063, 3, 2, 2, 2, 1065, 179, 3, 2, 2, 2, 1066, 1067, 7, 51, 2, 2, 1067, 1068, 5, 188, 95, 2, 1068, 1069, 5, 144, 73, 2, 1069, 181, 3, 2, 2, 2, 1070, 1072, 7, 25, 2, 2, 1071, 1073, 5, 130, 66, 2, 1072, 1071, 3, 2, 2, 2, 1072, 1073, 3, 2, 2, 2, 1073, 1080, 3, 2, 2, 2, 1074, 1076, 7, 18, 2, 2, 1075, 1077, 5, 130, 66, 2, 1076, 1075, 3, 2, 2, 2, 1076, 1077, 3, 2, 2, 2, 1077, 1079, 3, 2, 2, 2, 1078, 1074, 3, 2, 2, 2, 1079, 1082, 3, 2, 2, 2, 1080, 1078, 3, 2, 2, 2, 1080, 1081, 3, 2, 2, 2, 1081, 1083, 3, 2, 2, 2, 1082, 1080, 3, 2, 2, 2, 1083, 1097, 7, 26, 2, 2, 1084, 1093, 7, 36, 2, 2, 1085, 1090, 5, 130, 66, 2, 1086, 1087, 7, 18, 2, 2, 1087, 1089, 5, 130, 66, 2, 1088, 1086, 3, 2, 2, 2, 1089, 1092, 3, 2, 2, 2, 1090, 1088, 3, 2, 2, 2, 1090, 1091, 3, 2, 2, 2, 1091, 1094, 3, 2, 2, 2, 1092, 1090, 3, 2, 2, 2, 1093, 1085, 3, 2, 2, 2, 1093, 1094, 3, 2, 2, 2, 1094, 1095, 3, 2, 2, 2, 1095, 1097, 7, 37, 2, 2, 1096, 1070, 3, 2, 2, 2, 1096, 1084, 3, 2, 2, 2, 1097, 183, 3, 2, 2, 2, 1098, 1101, 5, 128, 65, 2, 1099, 1101, 5, 74, 38, 2, 1100, 1098, 3, 2, 2, 2, 1100, 1099, 3, 2, 2, 2, 1101, 185, 3, 2, 2, 2, 1102, 1104, 9, 15, 2, 2, 1103, 1105, 7, 108, 2, 2, 1104, 1103, 3, 2, 2, 2, 1104, 1105, 3, 2, 2, 2, 1105, 187, 3, 2, 2, 2, 1106, 1107, 9, 16, 2, 2, 1107, 189, 3, 2, 2, 2, 1108, 1110, 7, 109, 2, 2, 1109, 1108, 3, 2, 2, 2, 1110, 1111, 3, 2, 2, 2, 1111, 1109, 3, 2, 2, 2, 1111, 1112, 3, 2, 2, 2, 1112, 191, 3, 2, 2, 2, 1113, 1125, 7, 99, 2, 2, 1114, 1115, 7, 25, 2, 2, 1115, 1120, 5, 74, 38, 2, 1116, 1117, 7, 18, 2, 2, 1117, 1119, 5, 74, 38, 2, 1118, 1116, 3, 2, 2, 2, 1119, 1122, 3, 2, 2, 2, 1120, 1118, 3, 2, 2, 2, 1120, 1121, 3, 2, 2, 2, 1121, 1123, 3, 2, 2, 2, 1122, 1120, 3, 2, 2, 2, 1123, 1124, 7, 26, 2, 2, 1124, 1126, 3, 2, 2, 2, 1125, 1114, 3, 2, 2, 2, 1125, 1126, 3, 2, 2, 2, 1126, 193, 3, 2, 2, 2, 1127, 1129, 7, 131, 2, 2, 1128, 1127, 3, 2, 2, 2, 1129, 1130, 3, 2, 2, 2, 1130, 1128, 3, 2, 2, 2, 1130, 1131, 3, 2, 2, 2, 1131, 195, 3, 2, 2, 2, 128, 205, 207, 221, 225, 230, 236, 240, 243, 248, 254, 261, 265, 278, 286, 291, 301, 304, 310, 318, 321, 332, 341, 343, 349, 376, 390, 393, 400, 404, 406, 411, 416, 419, 425, 429, 433, 438, 451, 453, 460, 470, 476, 487, 490, 496, 499, 507, 510, 516, 519, 527, 530, 536, 540, 551, 556, 561, 569, 574, 588, 590, 595, 605, 625, 637, 642, 648, 652, 655, 667, 676, 680, 683, 690, 710, 732, 736, 741, 745, 749, 754, 759, 763, 787, 841, 845, 861, 863, 873, 881, 883, 890, 898, 902, 910, 914, 916, 927, 950, 955, 965, 969, 975, 979, 985, 997, 1004, 1018, 1027, 1033, 1037, 1047, 1052, 1064, 1072, 1076, 1080, 1090, 1093, 1096, 1100, 1104, 1111, 1120, 1125, 1130] -------------------------------------------------------------------------------- /solidity_parser/solidity_antlr4/Solidity.tokens: -------------------------------------------------------------------------------- 1 | T__0=1 2 | T__1=2 3 | T__2=3 4 | T__3=4 5 | T__4=5 6 | T__5=6 7 | T__6=7 8 | T__7=8 9 | T__8=9 10 | T__9=10 11 | T__10=11 12 | T__11=12 13 | T__12=13 14 | T__13=14 15 | T__14=15 16 | T__15=16 17 | T__16=17 18 | T__17=18 19 | T__18=19 20 | T__19=20 21 | T__20=21 22 | T__21=22 23 | T__22=23 24 | T__23=24 25 | T__24=25 26 | T__25=26 27 | T__26=27 28 | T__27=28 29 | T__28=29 30 | T__29=30 31 | T__30=31 32 | T__31=32 33 | T__32=33 34 | T__33=34 35 | T__34=35 36 | T__35=36 37 | T__36=37 38 | T__37=38 39 | T__38=39 40 | T__39=40 41 | T__40=41 42 | T__41=42 43 | T__42=43 44 | T__43=44 45 | T__44=45 46 | T__45=46 47 | T__46=47 48 | T__47=48 49 | T__48=49 50 | T__49=50 51 | T__50=51 52 | T__51=52 53 | T__52=53 54 | T__53=54 55 | T__54=55 56 | T__55=56 57 | T__56=57 58 | T__57=58 59 | T__58=59 60 | T__59=60 61 | T__60=61 62 | T__61=62 63 | T__62=63 64 | T__63=64 65 | T__64=65 66 | T__65=66 67 | T__66=67 68 | T__67=68 69 | T__68=69 70 | T__69=70 71 | T__70=71 72 | T__71=72 73 | T__72=73 74 | T__73=74 75 | T__74=75 76 | T__75=76 77 | T__76=77 78 | T__77=78 79 | T__78=79 80 | T__79=80 81 | T__80=81 82 | T__81=82 83 | T__82=83 84 | T__83=84 85 | T__84=85 86 | T__85=86 87 | T__86=87 88 | T__87=88 89 | T__88=89 90 | T__89=90 91 | T__90=91 92 | T__91=92 93 | T__92=93 94 | T__93=94 95 | T__94=95 96 | T__95=96 97 | T__96=97 98 | Int=98 99 | Uint=99 100 | Byte=100 101 | Fixed=101 102 | Ufixed=102 103 | BooleanLiteral=103 104 | DecimalNumber=104 105 | HexNumber=105 106 | NumberUnit=106 107 | HexLiteralFragment=107 108 | ReservedKeyword=108 109 | AnonymousKeyword=109 110 | BreakKeyword=110 111 | ConstantKeyword=111 112 | ImmutableKeyword=112 113 | ContinueKeyword=113 114 | LeaveKeyword=114 115 | ExternalKeyword=115 116 | IndexedKeyword=116 117 | InternalKeyword=117 118 | PayableKeyword=118 119 | PrivateKeyword=119 120 | PublicKeyword=120 121 | VirtualKeyword=121 122 | PureKeyword=122 123 | TypeKeyword=123 124 | ViewKeyword=124 125 | ConstructorKeyword=125 126 | FallbackKeyword=126 127 | ReceiveKeyword=127 128 | Identifier=128 129 | StringLiteralFragment=129 130 | VersionLiteral=130 131 | WS=131 132 | COMMENT=132 133 | LINE_COMMENT=133 134 | 'pragma'=1 135 | ';'=2 136 | '||'=3 137 | '^'=4 138 | '~'=5 139 | '>='=6 140 | '>'=7 141 | '<'=8 142 | '<='=9 143 | '='=10 144 | 'as'=11 145 | 'import'=12 146 | '*'=13 147 | 'from'=14 148 | '{'=15 149 | ','=16 150 | '}'=17 151 | 'abstract'=18 152 | 'contract'=19 153 | 'interface'=20 154 | 'library'=21 155 | 'is'=22 156 | '('=23 157 | ')'=24 158 | 'error'=25 159 | 'using'=26 160 | 'for'=27 161 | 'struct'=28 162 | 'modifier'=29 163 | 'function'=30 164 | 'returns'=31 165 | 'event'=32 166 | 'enum'=33 167 | '['=34 168 | ']'=35 169 | 'address'=36 170 | '.'=37 171 | 'mapping'=38 172 | '=>'=39 173 | 'memory'=40 174 | 'storage'=41 175 | 'calldata'=42 176 | 'if'=43 177 | 'else'=44 178 | 'try'=45 179 | 'catch'=46 180 | 'while'=47 181 | 'unchecked'=48 182 | 'assembly'=49 183 | 'do'=50 184 | 'return'=51 185 | 'throw'=52 186 | 'emit'=53 187 | 'revert'=54 188 | 'var'=55 189 | 'bool'=56 190 | 'string'=57 191 | 'byte'=58 192 | '++'=59 193 | '--'=60 194 | 'new'=61 195 | ':'=62 196 | '+'=63 197 | '-'=64 198 | 'after'=65 199 | 'delete'=66 200 | '!'=67 201 | '**'=68 202 | '/'=69 203 | '%'=70 204 | '<<'=71 205 | '>>'=72 206 | '&'=73 207 | '|'=74 208 | '=='=75 209 | '!='=76 210 | '&&'=77 211 | '?'=78 212 | '|='=79 213 | '^='=80 214 | '&='=81 215 | '<<='=82 216 | '>>='=83 217 | '+='=84 218 | '-='=85 219 | '*='=86 220 | '/='=87 221 | '%='=88 222 | 'let'=89 223 | ':='=90 224 | '=:'=91 225 | 'switch'=92 226 | 'case'=93 227 | 'default'=94 228 | '->'=95 229 | 'callback'=96 230 | 'override'=97 231 | 'anonymous'=109 232 | 'break'=110 233 | 'constant'=111 234 | 'immutable'=112 235 | 'continue'=113 236 | 'leave'=114 237 | 'external'=115 238 | 'indexed'=116 239 | 'internal'=117 240 | 'payable'=118 241 | 'private'=119 242 | 'public'=120 243 | 'virtual'=121 244 | 'pure'=122 245 | 'type'=123 246 | 'view'=124 247 | 'constructor'=125 248 | 'fallback'=126 249 | 'receive'=127 250 | -------------------------------------------------------------------------------- /solidity_parser/solidity_antlr4/SolidityLexer.tokens: -------------------------------------------------------------------------------- 1 | T__0=1 2 | T__1=2 3 | T__2=3 4 | T__3=4 5 | T__4=5 6 | T__5=6 7 | T__6=7 8 | T__7=8 9 | T__8=9 10 | T__9=10 11 | T__10=11 12 | T__11=12 13 | T__12=13 14 | T__13=14 15 | T__14=15 16 | T__15=16 17 | T__16=17 18 | T__17=18 19 | T__18=19 20 | T__19=20 21 | T__20=21 22 | T__21=22 23 | T__22=23 24 | T__23=24 25 | T__24=25 26 | T__25=26 27 | T__26=27 28 | T__27=28 29 | T__28=29 30 | T__29=30 31 | T__30=31 32 | T__31=32 33 | T__32=33 34 | T__33=34 35 | T__34=35 36 | T__35=36 37 | T__36=37 38 | T__37=38 39 | T__38=39 40 | T__39=40 41 | T__40=41 42 | T__41=42 43 | T__42=43 44 | T__43=44 45 | T__44=45 46 | T__45=46 47 | T__46=47 48 | T__47=48 49 | T__48=49 50 | T__49=50 51 | T__50=51 52 | T__51=52 53 | T__52=53 54 | T__53=54 55 | T__54=55 56 | T__55=56 57 | T__56=57 58 | T__57=58 59 | T__58=59 60 | T__59=60 61 | T__60=61 62 | T__61=62 63 | T__62=63 64 | T__63=64 65 | T__64=65 66 | T__65=66 67 | T__66=67 68 | T__67=68 69 | T__68=69 70 | T__69=70 71 | T__70=71 72 | T__71=72 73 | T__72=73 74 | T__73=74 75 | T__74=75 76 | T__75=76 77 | T__76=77 78 | T__77=78 79 | T__78=79 80 | T__79=80 81 | T__80=81 82 | T__81=82 83 | T__82=83 84 | T__83=84 85 | T__84=85 86 | T__85=86 87 | T__86=87 88 | T__87=88 89 | T__88=89 90 | T__89=90 91 | T__90=91 92 | T__91=92 93 | T__92=93 94 | T__93=94 95 | T__94=95 96 | T__95=96 97 | T__96=97 98 | Int=98 99 | Uint=99 100 | Byte=100 101 | Fixed=101 102 | Ufixed=102 103 | BooleanLiteral=103 104 | DecimalNumber=104 105 | HexNumber=105 106 | NumberUnit=106 107 | HexLiteralFragment=107 108 | ReservedKeyword=108 109 | AnonymousKeyword=109 110 | BreakKeyword=110 111 | ConstantKeyword=111 112 | ImmutableKeyword=112 113 | ContinueKeyword=113 114 | LeaveKeyword=114 115 | ExternalKeyword=115 116 | IndexedKeyword=116 117 | InternalKeyword=117 118 | PayableKeyword=118 119 | PrivateKeyword=119 120 | PublicKeyword=120 121 | VirtualKeyword=121 122 | PureKeyword=122 123 | TypeKeyword=123 124 | ViewKeyword=124 125 | ConstructorKeyword=125 126 | FallbackKeyword=126 127 | ReceiveKeyword=127 128 | Identifier=128 129 | StringLiteralFragment=129 130 | VersionLiteral=130 131 | WS=131 132 | COMMENT=132 133 | LINE_COMMENT=133 134 | 'pragma'=1 135 | ';'=2 136 | '||'=3 137 | '^'=4 138 | '~'=5 139 | '>='=6 140 | '>'=7 141 | '<'=8 142 | '<='=9 143 | '='=10 144 | 'as'=11 145 | 'import'=12 146 | '*'=13 147 | 'from'=14 148 | '{'=15 149 | ','=16 150 | '}'=17 151 | 'abstract'=18 152 | 'contract'=19 153 | 'interface'=20 154 | 'library'=21 155 | 'is'=22 156 | '('=23 157 | ')'=24 158 | 'error'=25 159 | 'using'=26 160 | 'for'=27 161 | 'struct'=28 162 | 'modifier'=29 163 | 'function'=30 164 | 'returns'=31 165 | 'event'=32 166 | 'enum'=33 167 | '['=34 168 | ']'=35 169 | 'address'=36 170 | '.'=37 171 | 'mapping'=38 172 | '=>'=39 173 | 'memory'=40 174 | 'storage'=41 175 | 'calldata'=42 176 | 'if'=43 177 | 'else'=44 178 | 'try'=45 179 | 'catch'=46 180 | 'while'=47 181 | 'unchecked'=48 182 | 'assembly'=49 183 | 'do'=50 184 | 'return'=51 185 | 'throw'=52 186 | 'emit'=53 187 | 'revert'=54 188 | 'var'=55 189 | 'bool'=56 190 | 'string'=57 191 | 'byte'=58 192 | '++'=59 193 | '--'=60 194 | 'new'=61 195 | ':'=62 196 | '+'=63 197 | '-'=64 198 | 'after'=65 199 | 'delete'=66 200 | '!'=67 201 | '**'=68 202 | '/'=69 203 | '%'=70 204 | '<<'=71 205 | '>>'=72 206 | '&'=73 207 | '|'=74 208 | '=='=75 209 | '!='=76 210 | '&&'=77 211 | '?'=78 212 | '|='=79 213 | '^='=80 214 | '&='=81 215 | '<<='=82 216 | '>>='=83 217 | '+='=84 218 | '-='=85 219 | '*='=86 220 | '/='=87 221 | '%='=88 222 | 'let'=89 223 | ':='=90 224 | '=:'=91 225 | 'switch'=92 226 | 'case'=93 227 | 'default'=94 228 | '->'=95 229 | 'callback'=96 230 | 'override'=97 231 | 'anonymous'=109 232 | 'break'=110 233 | 'constant'=111 234 | 'immutable'=112 235 | 'continue'=113 236 | 'leave'=114 237 | 'external'=115 238 | 'indexed'=116 239 | 'internal'=117 240 | 'payable'=118 241 | 'private'=119 242 | 'public'=120 243 | 'virtual'=121 244 | 'pure'=122 245 | 'type'=123 246 | 'view'=124 247 | 'constructor'=125 248 | 'fallback'=126 249 | 'receive'=127 250 | -------------------------------------------------------------------------------- /solidity_parser/solidity_antlr4/SolidityListener.py: -------------------------------------------------------------------------------- 1 | # Generated from solidity-antlr4/Solidity.g4 by ANTLR 4.9.3 2 | from antlr4 import * 3 | if __name__ is not None and "." in __name__: 4 | from .SolidityParser import SolidityParser 5 | else: 6 | from SolidityParser import SolidityParser 7 | 8 | # This class defines a complete listener for a parse tree produced by SolidityParser. 9 | class SolidityListener(ParseTreeListener): 10 | 11 | # Enter a parse tree produced by SolidityParser#sourceUnit. 12 | def enterSourceUnit(self, ctx:SolidityParser.SourceUnitContext): 13 | pass 14 | 15 | # Exit a parse tree produced by SolidityParser#sourceUnit. 16 | def exitSourceUnit(self, ctx:SolidityParser.SourceUnitContext): 17 | pass 18 | 19 | 20 | # Enter a parse tree produced by SolidityParser#pragmaDirective. 21 | def enterPragmaDirective(self, ctx:SolidityParser.PragmaDirectiveContext): 22 | pass 23 | 24 | # Exit a parse tree produced by SolidityParser#pragmaDirective. 25 | def exitPragmaDirective(self, ctx:SolidityParser.PragmaDirectiveContext): 26 | pass 27 | 28 | 29 | # Enter a parse tree produced by SolidityParser#pragmaName. 30 | def enterPragmaName(self, ctx:SolidityParser.PragmaNameContext): 31 | pass 32 | 33 | # Exit a parse tree produced by SolidityParser#pragmaName. 34 | def exitPragmaName(self, ctx:SolidityParser.PragmaNameContext): 35 | pass 36 | 37 | 38 | # Enter a parse tree produced by SolidityParser#pragmaValue. 39 | def enterPragmaValue(self, ctx:SolidityParser.PragmaValueContext): 40 | pass 41 | 42 | # Exit a parse tree produced by SolidityParser#pragmaValue. 43 | def exitPragmaValue(self, ctx:SolidityParser.PragmaValueContext): 44 | pass 45 | 46 | 47 | # Enter a parse tree produced by SolidityParser#version. 48 | def enterVersion(self, ctx:SolidityParser.VersionContext): 49 | pass 50 | 51 | # Exit a parse tree produced by SolidityParser#version. 52 | def exitVersion(self, ctx:SolidityParser.VersionContext): 53 | pass 54 | 55 | 56 | # Enter a parse tree produced by SolidityParser#versionOperator. 57 | def enterVersionOperator(self, ctx:SolidityParser.VersionOperatorContext): 58 | pass 59 | 60 | # Exit a parse tree produced by SolidityParser#versionOperator. 61 | def exitVersionOperator(self, ctx:SolidityParser.VersionOperatorContext): 62 | pass 63 | 64 | 65 | # Enter a parse tree produced by SolidityParser#versionConstraint. 66 | def enterVersionConstraint(self, ctx:SolidityParser.VersionConstraintContext): 67 | pass 68 | 69 | # Exit a parse tree produced by SolidityParser#versionConstraint. 70 | def exitVersionConstraint(self, ctx:SolidityParser.VersionConstraintContext): 71 | pass 72 | 73 | 74 | # Enter a parse tree produced by SolidityParser#importDeclaration. 75 | def enterImportDeclaration(self, ctx:SolidityParser.ImportDeclarationContext): 76 | pass 77 | 78 | # Exit a parse tree produced by SolidityParser#importDeclaration. 79 | def exitImportDeclaration(self, ctx:SolidityParser.ImportDeclarationContext): 80 | pass 81 | 82 | 83 | # Enter a parse tree produced by SolidityParser#importDirective. 84 | def enterImportDirective(self, ctx:SolidityParser.ImportDirectiveContext): 85 | pass 86 | 87 | # Exit a parse tree produced by SolidityParser#importDirective. 88 | def exitImportDirective(self, ctx:SolidityParser.ImportDirectiveContext): 89 | pass 90 | 91 | 92 | # Enter a parse tree produced by SolidityParser#importPath. 93 | def enterImportPath(self, ctx:SolidityParser.ImportPathContext): 94 | pass 95 | 96 | # Exit a parse tree produced by SolidityParser#importPath. 97 | def exitImportPath(self, ctx:SolidityParser.ImportPathContext): 98 | pass 99 | 100 | 101 | # Enter a parse tree produced by SolidityParser#contractDefinition. 102 | def enterContractDefinition(self, ctx:SolidityParser.ContractDefinitionContext): 103 | pass 104 | 105 | # Exit a parse tree produced by SolidityParser#contractDefinition. 106 | def exitContractDefinition(self, ctx:SolidityParser.ContractDefinitionContext): 107 | pass 108 | 109 | 110 | # Enter a parse tree produced by SolidityParser#inheritanceSpecifier. 111 | def enterInheritanceSpecifier(self, ctx:SolidityParser.InheritanceSpecifierContext): 112 | pass 113 | 114 | # Exit a parse tree produced by SolidityParser#inheritanceSpecifier. 115 | def exitInheritanceSpecifier(self, ctx:SolidityParser.InheritanceSpecifierContext): 116 | pass 117 | 118 | 119 | # Enter a parse tree produced by SolidityParser#contractPart. 120 | def enterContractPart(self, ctx:SolidityParser.ContractPartContext): 121 | pass 122 | 123 | # Exit a parse tree produced by SolidityParser#contractPart. 124 | def exitContractPart(self, ctx:SolidityParser.ContractPartContext): 125 | pass 126 | 127 | 128 | # Enter a parse tree produced by SolidityParser#stateVariableDeclaration. 129 | def enterStateVariableDeclaration(self, ctx:SolidityParser.StateVariableDeclarationContext): 130 | pass 131 | 132 | # Exit a parse tree produced by SolidityParser#stateVariableDeclaration. 133 | def exitStateVariableDeclaration(self, ctx:SolidityParser.StateVariableDeclarationContext): 134 | pass 135 | 136 | 137 | # Enter a parse tree produced by SolidityParser#fileLevelConstant. 138 | def enterFileLevelConstant(self, ctx:SolidityParser.FileLevelConstantContext): 139 | pass 140 | 141 | # Exit a parse tree produced by SolidityParser#fileLevelConstant. 142 | def exitFileLevelConstant(self, ctx:SolidityParser.FileLevelConstantContext): 143 | pass 144 | 145 | 146 | # Enter a parse tree produced by SolidityParser#customErrorDefinition. 147 | def enterCustomErrorDefinition(self, ctx:SolidityParser.CustomErrorDefinitionContext): 148 | pass 149 | 150 | # Exit a parse tree produced by SolidityParser#customErrorDefinition. 151 | def exitCustomErrorDefinition(self, ctx:SolidityParser.CustomErrorDefinitionContext): 152 | pass 153 | 154 | 155 | # Enter a parse tree produced by SolidityParser#typeDefinition. 156 | def enterTypeDefinition(self, ctx:SolidityParser.TypeDefinitionContext): 157 | pass 158 | 159 | # Exit a parse tree produced by SolidityParser#typeDefinition. 160 | def exitTypeDefinition(self, ctx:SolidityParser.TypeDefinitionContext): 161 | pass 162 | 163 | 164 | # Enter a parse tree produced by SolidityParser#usingForDeclaration. 165 | def enterUsingForDeclaration(self, ctx:SolidityParser.UsingForDeclarationContext): 166 | pass 167 | 168 | # Exit a parse tree produced by SolidityParser#usingForDeclaration. 169 | def exitUsingForDeclaration(self, ctx:SolidityParser.UsingForDeclarationContext): 170 | pass 171 | 172 | 173 | # Enter a parse tree produced by SolidityParser#structDefinition. 174 | def enterStructDefinition(self, ctx:SolidityParser.StructDefinitionContext): 175 | pass 176 | 177 | # Exit a parse tree produced by SolidityParser#structDefinition. 178 | def exitStructDefinition(self, ctx:SolidityParser.StructDefinitionContext): 179 | pass 180 | 181 | 182 | # Enter a parse tree produced by SolidityParser#modifierDefinition. 183 | def enterModifierDefinition(self, ctx:SolidityParser.ModifierDefinitionContext): 184 | pass 185 | 186 | # Exit a parse tree produced by SolidityParser#modifierDefinition. 187 | def exitModifierDefinition(self, ctx:SolidityParser.ModifierDefinitionContext): 188 | pass 189 | 190 | 191 | # Enter a parse tree produced by SolidityParser#modifierInvocation. 192 | def enterModifierInvocation(self, ctx:SolidityParser.ModifierInvocationContext): 193 | pass 194 | 195 | # Exit a parse tree produced by SolidityParser#modifierInvocation. 196 | def exitModifierInvocation(self, ctx:SolidityParser.ModifierInvocationContext): 197 | pass 198 | 199 | 200 | # Enter a parse tree produced by SolidityParser#functionDefinition. 201 | def enterFunctionDefinition(self, ctx:SolidityParser.FunctionDefinitionContext): 202 | pass 203 | 204 | # Exit a parse tree produced by SolidityParser#functionDefinition. 205 | def exitFunctionDefinition(self, ctx:SolidityParser.FunctionDefinitionContext): 206 | pass 207 | 208 | 209 | # Enter a parse tree produced by SolidityParser#functionDescriptor. 210 | def enterFunctionDescriptor(self, ctx:SolidityParser.FunctionDescriptorContext): 211 | pass 212 | 213 | # Exit a parse tree produced by SolidityParser#functionDescriptor. 214 | def exitFunctionDescriptor(self, ctx:SolidityParser.FunctionDescriptorContext): 215 | pass 216 | 217 | 218 | # Enter a parse tree produced by SolidityParser#returnParameters. 219 | def enterReturnParameters(self, ctx:SolidityParser.ReturnParametersContext): 220 | pass 221 | 222 | # Exit a parse tree produced by SolidityParser#returnParameters. 223 | def exitReturnParameters(self, ctx:SolidityParser.ReturnParametersContext): 224 | pass 225 | 226 | 227 | # Enter a parse tree produced by SolidityParser#modifierList. 228 | def enterModifierList(self, ctx:SolidityParser.ModifierListContext): 229 | pass 230 | 231 | # Exit a parse tree produced by SolidityParser#modifierList. 232 | def exitModifierList(self, ctx:SolidityParser.ModifierListContext): 233 | pass 234 | 235 | 236 | # Enter a parse tree produced by SolidityParser#eventDefinition. 237 | def enterEventDefinition(self, ctx:SolidityParser.EventDefinitionContext): 238 | pass 239 | 240 | # Exit a parse tree produced by SolidityParser#eventDefinition. 241 | def exitEventDefinition(self, ctx:SolidityParser.EventDefinitionContext): 242 | pass 243 | 244 | 245 | # Enter a parse tree produced by SolidityParser#enumValue. 246 | def enterEnumValue(self, ctx:SolidityParser.EnumValueContext): 247 | pass 248 | 249 | # Exit a parse tree produced by SolidityParser#enumValue. 250 | def exitEnumValue(self, ctx:SolidityParser.EnumValueContext): 251 | pass 252 | 253 | 254 | # Enter a parse tree produced by SolidityParser#enumDefinition. 255 | def enterEnumDefinition(self, ctx:SolidityParser.EnumDefinitionContext): 256 | pass 257 | 258 | # Exit a parse tree produced by SolidityParser#enumDefinition. 259 | def exitEnumDefinition(self, ctx:SolidityParser.EnumDefinitionContext): 260 | pass 261 | 262 | 263 | # Enter a parse tree produced by SolidityParser#parameterList. 264 | def enterParameterList(self, ctx:SolidityParser.ParameterListContext): 265 | pass 266 | 267 | # Exit a parse tree produced by SolidityParser#parameterList. 268 | def exitParameterList(self, ctx:SolidityParser.ParameterListContext): 269 | pass 270 | 271 | 272 | # Enter a parse tree produced by SolidityParser#parameter. 273 | def enterParameter(self, ctx:SolidityParser.ParameterContext): 274 | pass 275 | 276 | # Exit a parse tree produced by SolidityParser#parameter. 277 | def exitParameter(self, ctx:SolidityParser.ParameterContext): 278 | pass 279 | 280 | 281 | # Enter a parse tree produced by SolidityParser#eventParameterList. 282 | def enterEventParameterList(self, ctx:SolidityParser.EventParameterListContext): 283 | pass 284 | 285 | # Exit a parse tree produced by SolidityParser#eventParameterList. 286 | def exitEventParameterList(self, ctx:SolidityParser.EventParameterListContext): 287 | pass 288 | 289 | 290 | # Enter a parse tree produced by SolidityParser#eventParameter. 291 | def enterEventParameter(self, ctx:SolidityParser.EventParameterContext): 292 | pass 293 | 294 | # Exit a parse tree produced by SolidityParser#eventParameter. 295 | def exitEventParameter(self, ctx:SolidityParser.EventParameterContext): 296 | pass 297 | 298 | 299 | # Enter a parse tree produced by SolidityParser#functionTypeParameterList. 300 | def enterFunctionTypeParameterList(self, ctx:SolidityParser.FunctionTypeParameterListContext): 301 | pass 302 | 303 | # Exit a parse tree produced by SolidityParser#functionTypeParameterList. 304 | def exitFunctionTypeParameterList(self, ctx:SolidityParser.FunctionTypeParameterListContext): 305 | pass 306 | 307 | 308 | # Enter a parse tree produced by SolidityParser#functionTypeParameter. 309 | def enterFunctionTypeParameter(self, ctx:SolidityParser.FunctionTypeParameterContext): 310 | pass 311 | 312 | # Exit a parse tree produced by SolidityParser#functionTypeParameter. 313 | def exitFunctionTypeParameter(self, ctx:SolidityParser.FunctionTypeParameterContext): 314 | pass 315 | 316 | 317 | # Enter a parse tree produced by SolidityParser#variableDeclaration. 318 | def enterVariableDeclaration(self, ctx:SolidityParser.VariableDeclarationContext): 319 | pass 320 | 321 | # Exit a parse tree produced by SolidityParser#variableDeclaration. 322 | def exitVariableDeclaration(self, ctx:SolidityParser.VariableDeclarationContext): 323 | pass 324 | 325 | 326 | # Enter a parse tree produced by SolidityParser#typeName. 327 | def enterTypeName(self, ctx:SolidityParser.TypeNameContext): 328 | pass 329 | 330 | # Exit a parse tree produced by SolidityParser#typeName. 331 | def exitTypeName(self, ctx:SolidityParser.TypeNameContext): 332 | pass 333 | 334 | 335 | # Enter a parse tree produced by SolidityParser#userDefinedTypeName. 336 | def enterUserDefinedTypeName(self, ctx:SolidityParser.UserDefinedTypeNameContext): 337 | pass 338 | 339 | # Exit a parse tree produced by SolidityParser#userDefinedTypeName. 340 | def exitUserDefinedTypeName(self, ctx:SolidityParser.UserDefinedTypeNameContext): 341 | pass 342 | 343 | 344 | # Enter a parse tree produced by SolidityParser#mappingKey. 345 | def enterMappingKey(self, ctx:SolidityParser.MappingKeyContext): 346 | pass 347 | 348 | # Exit a parse tree produced by SolidityParser#mappingKey. 349 | def exitMappingKey(self, ctx:SolidityParser.MappingKeyContext): 350 | pass 351 | 352 | 353 | # Enter a parse tree produced by SolidityParser#mapping. 354 | def enterMapping(self, ctx:SolidityParser.MappingContext): 355 | pass 356 | 357 | # Exit a parse tree produced by SolidityParser#mapping. 358 | def exitMapping(self, ctx:SolidityParser.MappingContext): 359 | pass 360 | 361 | 362 | # Enter a parse tree produced by SolidityParser#functionTypeName. 363 | def enterFunctionTypeName(self, ctx:SolidityParser.FunctionTypeNameContext): 364 | pass 365 | 366 | # Exit a parse tree produced by SolidityParser#functionTypeName. 367 | def exitFunctionTypeName(self, ctx:SolidityParser.FunctionTypeNameContext): 368 | pass 369 | 370 | 371 | # Enter a parse tree produced by SolidityParser#storageLocation. 372 | def enterStorageLocation(self, ctx:SolidityParser.StorageLocationContext): 373 | pass 374 | 375 | # Exit a parse tree produced by SolidityParser#storageLocation. 376 | def exitStorageLocation(self, ctx:SolidityParser.StorageLocationContext): 377 | pass 378 | 379 | 380 | # Enter a parse tree produced by SolidityParser#stateMutability. 381 | def enterStateMutability(self, ctx:SolidityParser.StateMutabilityContext): 382 | pass 383 | 384 | # Exit a parse tree produced by SolidityParser#stateMutability. 385 | def exitStateMutability(self, ctx:SolidityParser.StateMutabilityContext): 386 | pass 387 | 388 | 389 | # Enter a parse tree produced by SolidityParser#block. 390 | def enterBlock(self, ctx:SolidityParser.BlockContext): 391 | pass 392 | 393 | # Exit a parse tree produced by SolidityParser#block. 394 | def exitBlock(self, ctx:SolidityParser.BlockContext): 395 | pass 396 | 397 | 398 | # Enter a parse tree produced by SolidityParser#statement. 399 | def enterStatement(self, ctx:SolidityParser.StatementContext): 400 | pass 401 | 402 | # Exit a parse tree produced by SolidityParser#statement. 403 | def exitStatement(self, ctx:SolidityParser.StatementContext): 404 | pass 405 | 406 | 407 | # Enter a parse tree produced by SolidityParser#expressionStatement. 408 | def enterExpressionStatement(self, ctx:SolidityParser.ExpressionStatementContext): 409 | pass 410 | 411 | # Exit a parse tree produced by SolidityParser#expressionStatement. 412 | def exitExpressionStatement(self, ctx:SolidityParser.ExpressionStatementContext): 413 | pass 414 | 415 | 416 | # Enter a parse tree produced by SolidityParser#ifStatement. 417 | def enterIfStatement(self, ctx:SolidityParser.IfStatementContext): 418 | pass 419 | 420 | # Exit a parse tree produced by SolidityParser#ifStatement. 421 | def exitIfStatement(self, ctx:SolidityParser.IfStatementContext): 422 | pass 423 | 424 | 425 | # Enter a parse tree produced by SolidityParser#tryStatement. 426 | def enterTryStatement(self, ctx:SolidityParser.TryStatementContext): 427 | pass 428 | 429 | # Exit a parse tree produced by SolidityParser#tryStatement. 430 | def exitTryStatement(self, ctx:SolidityParser.TryStatementContext): 431 | pass 432 | 433 | 434 | # Enter a parse tree produced by SolidityParser#catchClause. 435 | def enterCatchClause(self, ctx:SolidityParser.CatchClauseContext): 436 | pass 437 | 438 | # Exit a parse tree produced by SolidityParser#catchClause. 439 | def exitCatchClause(self, ctx:SolidityParser.CatchClauseContext): 440 | pass 441 | 442 | 443 | # Enter a parse tree produced by SolidityParser#whileStatement. 444 | def enterWhileStatement(self, ctx:SolidityParser.WhileStatementContext): 445 | pass 446 | 447 | # Exit a parse tree produced by SolidityParser#whileStatement. 448 | def exitWhileStatement(self, ctx:SolidityParser.WhileStatementContext): 449 | pass 450 | 451 | 452 | # Enter a parse tree produced by SolidityParser#simpleStatement. 453 | def enterSimpleStatement(self, ctx:SolidityParser.SimpleStatementContext): 454 | pass 455 | 456 | # Exit a parse tree produced by SolidityParser#simpleStatement. 457 | def exitSimpleStatement(self, ctx:SolidityParser.SimpleStatementContext): 458 | pass 459 | 460 | 461 | # Enter a parse tree produced by SolidityParser#uncheckedStatement. 462 | def enterUncheckedStatement(self, ctx:SolidityParser.UncheckedStatementContext): 463 | pass 464 | 465 | # Exit a parse tree produced by SolidityParser#uncheckedStatement. 466 | def exitUncheckedStatement(self, ctx:SolidityParser.UncheckedStatementContext): 467 | pass 468 | 469 | 470 | # Enter a parse tree produced by SolidityParser#forStatement. 471 | def enterForStatement(self, ctx:SolidityParser.ForStatementContext): 472 | pass 473 | 474 | # Exit a parse tree produced by SolidityParser#forStatement. 475 | def exitForStatement(self, ctx:SolidityParser.ForStatementContext): 476 | pass 477 | 478 | 479 | # Enter a parse tree produced by SolidityParser#inlineAssemblyStatement. 480 | def enterInlineAssemblyStatement(self, ctx:SolidityParser.InlineAssemblyStatementContext): 481 | pass 482 | 483 | # Exit a parse tree produced by SolidityParser#inlineAssemblyStatement. 484 | def exitInlineAssemblyStatement(self, ctx:SolidityParser.InlineAssemblyStatementContext): 485 | pass 486 | 487 | 488 | # Enter a parse tree produced by SolidityParser#doWhileStatement. 489 | def enterDoWhileStatement(self, ctx:SolidityParser.DoWhileStatementContext): 490 | pass 491 | 492 | # Exit a parse tree produced by SolidityParser#doWhileStatement. 493 | def exitDoWhileStatement(self, ctx:SolidityParser.DoWhileStatementContext): 494 | pass 495 | 496 | 497 | # Enter a parse tree produced by SolidityParser#continueStatement. 498 | def enterContinueStatement(self, ctx:SolidityParser.ContinueStatementContext): 499 | pass 500 | 501 | # Exit a parse tree produced by SolidityParser#continueStatement. 502 | def exitContinueStatement(self, ctx:SolidityParser.ContinueStatementContext): 503 | pass 504 | 505 | 506 | # Enter a parse tree produced by SolidityParser#breakStatement. 507 | def enterBreakStatement(self, ctx:SolidityParser.BreakStatementContext): 508 | pass 509 | 510 | # Exit a parse tree produced by SolidityParser#breakStatement. 511 | def exitBreakStatement(self, ctx:SolidityParser.BreakStatementContext): 512 | pass 513 | 514 | 515 | # Enter a parse tree produced by SolidityParser#returnStatement. 516 | def enterReturnStatement(self, ctx:SolidityParser.ReturnStatementContext): 517 | pass 518 | 519 | # Exit a parse tree produced by SolidityParser#returnStatement. 520 | def exitReturnStatement(self, ctx:SolidityParser.ReturnStatementContext): 521 | pass 522 | 523 | 524 | # Enter a parse tree produced by SolidityParser#throwStatement. 525 | def enterThrowStatement(self, ctx:SolidityParser.ThrowStatementContext): 526 | pass 527 | 528 | # Exit a parse tree produced by SolidityParser#throwStatement. 529 | def exitThrowStatement(self, ctx:SolidityParser.ThrowStatementContext): 530 | pass 531 | 532 | 533 | # Enter a parse tree produced by SolidityParser#emitStatement. 534 | def enterEmitStatement(self, ctx:SolidityParser.EmitStatementContext): 535 | pass 536 | 537 | # Exit a parse tree produced by SolidityParser#emitStatement. 538 | def exitEmitStatement(self, ctx:SolidityParser.EmitStatementContext): 539 | pass 540 | 541 | 542 | # Enter a parse tree produced by SolidityParser#revertStatement. 543 | def enterRevertStatement(self, ctx:SolidityParser.RevertStatementContext): 544 | pass 545 | 546 | # Exit a parse tree produced by SolidityParser#revertStatement. 547 | def exitRevertStatement(self, ctx:SolidityParser.RevertStatementContext): 548 | pass 549 | 550 | 551 | # Enter a parse tree produced by SolidityParser#variableDeclarationStatement. 552 | def enterVariableDeclarationStatement(self, ctx:SolidityParser.VariableDeclarationStatementContext): 553 | pass 554 | 555 | # Exit a parse tree produced by SolidityParser#variableDeclarationStatement. 556 | def exitVariableDeclarationStatement(self, ctx:SolidityParser.VariableDeclarationStatementContext): 557 | pass 558 | 559 | 560 | # Enter a parse tree produced by SolidityParser#variableDeclarationList. 561 | def enterVariableDeclarationList(self, ctx:SolidityParser.VariableDeclarationListContext): 562 | pass 563 | 564 | # Exit a parse tree produced by SolidityParser#variableDeclarationList. 565 | def exitVariableDeclarationList(self, ctx:SolidityParser.VariableDeclarationListContext): 566 | pass 567 | 568 | 569 | # Enter a parse tree produced by SolidityParser#identifierList. 570 | def enterIdentifierList(self, ctx:SolidityParser.IdentifierListContext): 571 | pass 572 | 573 | # Exit a parse tree produced by SolidityParser#identifierList. 574 | def exitIdentifierList(self, ctx:SolidityParser.IdentifierListContext): 575 | pass 576 | 577 | 578 | # Enter a parse tree produced by SolidityParser#elementaryTypeName. 579 | def enterElementaryTypeName(self, ctx:SolidityParser.ElementaryTypeNameContext): 580 | pass 581 | 582 | # Exit a parse tree produced by SolidityParser#elementaryTypeName. 583 | def exitElementaryTypeName(self, ctx:SolidityParser.ElementaryTypeNameContext): 584 | pass 585 | 586 | 587 | # Enter a parse tree produced by SolidityParser#expression. 588 | def enterExpression(self, ctx:SolidityParser.ExpressionContext): 589 | pass 590 | 591 | # Exit a parse tree produced by SolidityParser#expression. 592 | def exitExpression(self, ctx:SolidityParser.ExpressionContext): 593 | pass 594 | 595 | 596 | # Enter a parse tree produced by SolidityParser#primaryExpression. 597 | def enterPrimaryExpression(self, ctx:SolidityParser.PrimaryExpressionContext): 598 | pass 599 | 600 | # Exit a parse tree produced by SolidityParser#primaryExpression. 601 | def exitPrimaryExpression(self, ctx:SolidityParser.PrimaryExpressionContext): 602 | pass 603 | 604 | 605 | # Enter a parse tree produced by SolidityParser#expressionList. 606 | def enterExpressionList(self, ctx:SolidityParser.ExpressionListContext): 607 | pass 608 | 609 | # Exit a parse tree produced by SolidityParser#expressionList. 610 | def exitExpressionList(self, ctx:SolidityParser.ExpressionListContext): 611 | pass 612 | 613 | 614 | # Enter a parse tree produced by SolidityParser#nameValueList. 615 | def enterNameValueList(self, ctx:SolidityParser.NameValueListContext): 616 | pass 617 | 618 | # Exit a parse tree produced by SolidityParser#nameValueList. 619 | def exitNameValueList(self, ctx:SolidityParser.NameValueListContext): 620 | pass 621 | 622 | 623 | # Enter a parse tree produced by SolidityParser#nameValue. 624 | def enterNameValue(self, ctx:SolidityParser.NameValueContext): 625 | pass 626 | 627 | # Exit a parse tree produced by SolidityParser#nameValue. 628 | def exitNameValue(self, ctx:SolidityParser.NameValueContext): 629 | pass 630 | 631 | 632 | # Enter a parse tree produced by SolidityParser#functionCallArguments. 633 | def enterFunctionCallArguments(self, ctx:SolidityParser.FunctionCallArgumentsContext): 634 | pass 635 | 636 | # Exit a parse tree produced by SolidityParser#functionCallArguments. 637 | def exitFunctionCallArguments(self, ctx:SolidityParser.FunctionCallArgumentsContext): 638 | pass 639 | 640 | 641 | # Enter a parse tree produced by SolidityParser#functionCall. 642 | def enterFunctionCall(self, ctx:SolidityParser.FunctionCallContext): 643 | pass 644 | 645 | # Exit a parse tree produced by SolidityParser#functionCall. 646 | def exitFunctionCall(self, ctx:SolidityParser.FunctionCallContext): 647 | pass 648 | 649 | 650 | # Enter a parse tree produced by SolidityParser#assemblyBlock. 651 | def enterAssemblyBlock(self, ctx:SolidityParser.AssemblyBlockContext): 652 | pass 653 | 654 | # Exit a parse tree produced by SolidityParser#assemblyBlock. 655 | def exitAssemblyBlock(self, ctx:SolidityParser.AssemblyBlockContext): 656 | pass 657 | 658 | 659 | # Enter a parse tree produced by SolidityParser#assemblyItem. 660 | def enterAssemblyItem(self, ctx:SolidityParser.AssemblyItemContext): 661 | pass 662 | 663 | # Exit a parse tree produced by SolidityParser#assemblyItem. 664 | def exitAssemblyItem(self, ctx:SolidityParser.AssemblyItemContext): 665 | pass 666 | 667 | 668 | # Enter a parse tree produced by SolidityParser#assemblyExpression. 669 | def enterAssemblyExpression(self, ctx:SolidityParser.AssemblyExpressionContext): 670 | pass 671 | 672 | # Exit a parse tree produced by SolidityParser#assemblyExpression. 673 | def exitAssemblyExpression(self, ctx:SolidityParser.AssemblyExpressionContext): 674 | pass 675 | 676 | 677 | # Enter a parse tree produced by SolidityParser#assemblyMember. 678 | def enterAssemblyMember(self, ctx:SolidityParser.AssemblyMemberContext): 679 | pass 680 | 681 | # Exit a parse tree produced by SolidityParser#assemblyMember. 682 | def exitAssemblyMember(self, ctx:SolidityParser.AssemblyMemberContext): 683 | pass 684 | 685 | 686 | # Enter a parse tree produced by SolidityParser#assemblyCall. 687 | def enterAssemblyCall(self, ctx:SolidityParser.AssemblyCallContext): 688 | pass 689 | 690 | # Exit a parse tree produced by SolidityParser#assemblyCall. 691 | def exitAssemblyCall(self, ctx:SolidityParser.AssemblyCallContext): 692 | pass 693 | 694 | 695 | # Enter a parse tree produced by SolidityParser#assemblyLocalDefinition. 696 | def enterAssemblyLocalDefinition(self, ctx:SolidityParser.AssemblyLocalDefinitionContext): 697 | pass 698 | 699 | # Exit a parse tree produced by SolidityParser#assemblyLocalDefinition. 700 | def exitAssemblyLocalDefinition(self, ctx:SolidityParser.AssemblyLocalDefinitionContext): 701 | pass 702 | 703 | 704 | # Enter a parse tree produced by SolidityParser#assemblyAssignment. 705 | def enterAssemblyAssignment(self, ctx:SolidityParser.AssemblyAssignmentContext): 706 | pass 707 | 708 | # Exit a parse tree produced by SolidityParser#assemblyAssignment. 709 | def exitAssemblyAssignment(self, ctx:SolidityParser.AssemblyAssignmentContext): 710 | pass 711 | 712 | 713 | # Enter a parse tree produced by SolidityParser#assemblyIdentifierOrList. 714 | def enterAssemblyIdentifierOrList(self, ctx:SolidityParser.AssemblyIdentifierOrListContext): 715 | pass 716 | 717 | # Exit a parse tree produced by SolidityParser#assemblyIdentifierOrList. 718 | def exitAssemblyIdentifierOrList(self, ctx:SolidityParser.AssemblyIdentifierOrListContext): 719 | pass 720 | 721 | 722 | # Enter a parse tree produced by SolidityParser#assemblyIdentifierList. 723 | def enterAssemblyIdentifierList(self, ctx:SolidityParser.AssemblyIdentifierListContext): 724 | pass 725 | 726 | # Exit a parse tree produced by SolidityParser#assemblyIdentifierList. 727 | def exitAssemblyIdentifierList(self, ctx:SolidityParser.AssemblyIdentifierListContext): 728 | pass 729 | 730 | 731 | # Enter a parse tree produced by SolidityParser#assemblyStackAssignment. 732 | def enterAssemblyStackAssignment(self, ctx:SolidityParser.AssemblyStackAssignmentContext): 733 | pass 734 | 735 | # Exit a parse tree produced by SolidityParser#assemblyStackAssignment. 736 | def exitAssemblyStackAssignment(self, ctx:SolidityParser.AssemblyStackAssignmentContext): 737 | pass 738 | 739 | 740 | # Enter a parse tree produced by SolidityParser#labelDefinition. 741 | def enterLabelDefinition(self, ctx:SolidityParser.LabelDefinitionContext): 742 | pass 743 | 744 | # Exit a parse tree produced by SolidityParser#labelDefinition. 745 | def exitLabelDefinition(self, ctx:SolidityParser.LabelDefinitionContext): 746 | pass 747 | 748 | 749 | # Enter a parse tree produced by SolidityParser#assemblySwitch. 750 | def enterAssemblySwitch(self, ctx:SolidityParser.AssemblySwitchContext): 751 | pass 752 | 753 | # Exit a parse tree produced by SolidityParser#assemblySwitch. 754 | def exitAssemblySwitch(self, ctx:SolidityParser.AssemblySwitchContext): 755 | pass 756 | 757 | 758 | # Enter a parse tree produced by SolidityParser#assemblyCase. 759 | def enterAssemblyCase(self, ctx:SolidityParser.AssemblyCaseContext): 760 | pass 761 | 762 | # Exit a parse tree produced by SolidityParser#assemblyCase. 763 | def exitAssemblyCase(self, ctx:SolidityParser.AssemblyCaseContext): 764 | pass 765 | 766 | 767 | # Enter a parse tree produced by SolidityParser#assemblyFunctionDefinition. 768 | def enterAssemblyFunctionDefinition(self, ctx:SolidityParser.AssemblyFunctionDefinitionContext): 769 | pass 770 | 771 | # Exit a parse tree produced by SolidityParser#assemblyFunctionDefinition. 772 | def exitAssemblyFunctionDefinition(self, ctx:SolidityParser.AssemblyFunctionDefinitionContext): 773 | pass 774 | 775 | 776 | # Enter a parse tree produced by SolidityParser#assemblyFunctionReturns. 777 | def enterAssemblyFunctionReturns(self, ctx:SolidityParser.AssemblyFunctionReturnsContext): 778 | pass 779 | 780 | # Exit a parse tree produced by SolidityParser#assemblyFunctionReturns. 781 | def exitAssemblyFunctionReturns(self, ctx:SolidityParser.AssemblyFunctionReturnsContext): 782 | pass 783 | 784 | 785 | # Enter a parse tree produced by SolidityParser#assemblyFor. 786 | def enterAssemblyFor(self, ctx:SolidityParser.AssemblyForContext): 787 | pass 788 | 789 | # Exit a parse tree produced by SolidityParser#assemblyFor. 790 | def exitAssemblyFor(self, ctx:SolidityParser.AssemblyForContext): 791 | pass 792 | 793 | 794 | # Enter a parse tree produced by SolidityParser#assemblyIf. 795 | def enterAssemblyIf(self, ctx:SolidityParser.AssemblyIfContext): 796 | pass 797 | 798 | # Exit a parse tree produced by SolidityParser#assemblyIf. 799 | def exitAssemblyIf(self, ctx:SolidityParser.AssemblyIfContext): 800 | pass 801 | 802 | 803 | # Enter a parse tree produced by SolidityParser#assemblyLiteral. 804 | def enterAssemblyLiteral(self, ctx:SolidityParser.AssemblyLiteralContext): 805 | pass 806 | 807 | # Exit a parse tree produced by SolidityParser#assemblyLiteral. 808 | def exitAssemblyLiteral(self, ctx:SolidityParser.AssemblyLiteralContext): 809 | pass 810 | 811 | 812 | # Enter a parse tree produced by SolidityParser#subAssembly. 813 | def enterSubAssembly(self, ctx:SolidityParser.SubAssemblyContext): 814 | pass 815 | 816 | # Exit a parse tree produced by SolidityParser#subAssembly. 817 | def exitSubAssembly(self, ctx:SolidityParser.SubAssemblyContext): 818 | pass 819 | 820 | 821 | # Enter a parse tree produced by SolidityParser#tupleExpression. 822 | def enterTupleExpression(self, ctx:SolidityParser.TupleExpressionContext): 823 | pass 824 | 825 | # Exit a parse tree produced by SolidityParser#tupleExpression. 826 | def exitTupleExpression(self, ctx:SolidityParser.TupleExpressionContext): 827 | pass 828 | 829 | 830 | # Enter a parse tree produced by SolidityParser#typeNameExpression. 831 | def enterTypeNameExpression(self, ctx:SolidityParser.TypeNameExpressionContext): 832 | pass 833 | 834 | # Exit a parse tree produced by SolidityParser#typeNameExpression. 835 | def exitTypeNameExpression(self, ctx:SolidityParser.TypeNameExpressionContext): 836 | pass 837 | 838 | 839 | # Enter a parse tree produced by SolidityParser#numberLiteral. 840 | def enterNumberLiteral(self, ctx:SolidityParser.NumberLiteralContext): 841 | pass 842 | 843 | # Exit a parse tree produced by SolidityParser#numberLiteral. 844 | def exitNumberLiteral(self, ctx:SolidityParser.NumberLiteralContext): 845 | pass 846 | 847 | 848 | # Enter a parse tree produced by SolidityParser#identifier. 849 | def enterIdentifier(self, ctx:SolidityParser.IdentifierContext): 850 | pass 851 | 852 | # Exit a parse tree produced by SolidityParser#identifier. 853 | def exitIdentifier(self, ctx:SolidityParser.IdentifierContext): 854 | pass 855 | 856 | 857 | # Enter a parse tree produced by SolidityParser#hexLiteral. 858 | def enterHexLiteral(self, ctx:SolidityParser.HexLiteralContext): 859 | pass 860 | 861 | # Exit a parse tree produced by SolidityParser#hexLiteral. 862 | def exitHexLiteral(self, ctx:SolidityParser.HexLiteralContext): 863 | pass 864 | 865 | 866 | # Enter a parse tree produced by SolidityParser#overrideSpecifier. 867 | def enterOverrideSpecifier(self, ctx:SolidityParser.OverrideSpecifierContext): 868 | pass 869 | 870 | # Exit a parse tree produced by SolidityParser#overrideSpecifier. 871 | def exitOverrideSpecifier(self, ctx:SolidityParser.OverrideSpecifierContext): 872 | pass 873 | 874 | 875 | # Enter a parse tree produced by SolidityParser#stringLiteral. 876 | def enterStringLiteral(self, ctx:SolidityParser.StringLiteralContext): 877 | pass 878 | 879 | # Exit a parse tree produced by SolidityParser#stringLiteral. 880 | def exitStringLiteral(self, ctx:SolidityParser.StringLiteralContext): 881 | pass 882 | 883 | 884 | 885 | del SolidityParser -------------------------------------------------------------------------------- /solidity_parser/solidity_antlr4/SolidityVisitor.py: -------------------------------------------------------------------------------- 1 | # Generated from solidity-antlr4/Solidity.g4 by ANTLR 4.9.3 2 | from antlr4 import * 3 | if __name__ is not None and "." in __name__: 4 | from .SolidityParser import SolidityParser 5 | else: 6 | from SolidityParser import SolidityParser 7 | 8 | # This class defines a complete generic visitor for a parse tree produced by SolidityParser. 9 | 10 | class SolidityVisitor(ParseTreeVisitor): 11 | 12 | # Visit a parse tree produced by SolidityParser#sourceUnit. 13 | def visitSourceUnit(self, ctx:SolidityParser.SourceUnitContext): 14 | return self.visitChildren(ctx) 15 | 16 | 17 | # Visit a parse tree produced by SolidityParser#pragmaDirective. 18 | def visitPragmaDirective(self, ctx:SolidityParser.PragmaDirectiveContext): 19 | return self.visitChildren(ctx) 20 | 21 | 22 | # Visit a parse tree produced by SolidityParser#pragmaName. 23 | def visitPragmaName(self, ctx:SolidityParser.PragmaNameContext): 24 | return self.visitChildren(ctx) 25 | 26 | 27 | # Visit a parse tree produced by SolidityParser#pragmaValue. 28 | def visitPragmaValue(self, ctx:SolidityParser.PragmaValueContext): 29 | return self.visitChildren(ctx) 30 | 31 | 32 | # Visit a parse tree produced by SolidityParser#version. 33 | def visitVersion(self, ctx:SolidityParser.VersionContext): 34 | return self.visitChildren(ctx) 35 | 36 | 37 | # Visit a parse tree produced by SolidityParser#versionOperator. 38 | def visitVersionOperator(self, ctx:SolidityParser.VersionOperatorContext): 39 | return self.visitChildren(ctx) 40 | 41 | 42 | # Visit a parse tree produced by SolidityParser#versionConstraint. 43 | def visitVersionConstraint(self, ctx:SolidityParser.VersionConstraintContext): 44 | return self.visitChildren(ctx) 45 | 46 | 47 | # Visit a parse tree produced by SolidityParser#importDeclaration. 48 | def visitImportDeclaration(self, ctx:SolidityParser.ImportDeclarationContext): 49 | return self.visitChildren(ctx) 50 | 51 | 52 | # Visit a parse tree produced by SolidityParser#importDirective. 53 | def visitImportDirective(self, ctx:SolidityParser.ImportDirectiveContext): 54 | return self.visitChildren(ctx) 55 | 56 | 57 | # Visit a parse tree produced by SolidityParser#importPath. 58 | def visitImportPath(self, ctx:SolidityParser.ImportPathContext): 59 | return self.visitChildren(ctx) 60 | 61 | 62 | # Visit a parse tree produced by SolidityParser#contractDefinition. 63 | def visitContractDefinition(self, ctx:SolidityParser.ContractDefinitionContext): 64 | return self.visitChildren(ctx) 65 | 66 | 67 | # Visit a parse tree produced by SolidityParser#inheritanceSpecifier. 68 | def visitInheritanceSpecifier(self, ctx:SolidityParser.InheritanceSpecifierContext): 69 | return self.visitChildren(ctx) 70 | 71 | 72 | # Visit a parse tree produced by SolidityParser#contractPart. 73 | def visitContractPart(self, ctx:SolidityParser.ContractPartContext): 74 | return self.visitChildren(ctx) 75 | 76 | 77 | # Visit a parse tree produced by SolidityParser#stateVariableDeclaration. 78 | def visitStateVariableDeclaration(self, ctx:SolidityParser.StateVariableDeclarationContext): 79 | return self.visitChildren(ctx) 80 | 81 | 82 | # Visit a parse tree produced by SolidityParser#fileLevelConstant. 83 | def visitFileLevelConstant(self, ctx:SolidityParser.FileLevelConstantContext): 84 | return self.visitChildren(ctx) 85 | 86 | 87 | # Visit a parse tree produced by SolidityParser#customErrorDefinition. 88 | def visitCustomErrorDefinition(self, ctx:SolidityParser.CustomErrorDefinitionContext): 89 | return self.visitChildren(ctx) 90 | 91 | 92 | # Visit a parse tree produced by SolidityParser#typeDefinition. 93 | def visitTypeDefinition(self, ctx:SolidityParser.TypeDefinitionContext): 94 | return self.visitChildren(ctx) 95 | 96 | 97 | # Visit a parse tree produced by SolidityParser#usingForDeclaration. 98 | def visitUsingForDeclaration(self, ctx:SolidityParser.UsingForDeclarationContext): 99 | return self.visitChildren(ctx) 100 | 101 | 102 | # Visit a parse tree produced by SolidityParser#structDefinition. 103 | def visitStructDefinition(self, ctx:SolidityParser.StructDefinitionContext): 104 | return self.visitChildren(ctx) 105 | 106 | 107 | # Visit a parse tree produced by SolidityParser#modifierDefinition. 108 | def visitModifierDefinition(self, ctx:SolidityParser.ModifierDefinitionContext): 109 | return self.visitChildren(ctx) 110 | 111 | 112 | # Visit a parse tree produced by SolidityParser#modifierInvocation. 113 | def visitModifierInvocation(self, ctx:SolidityParser.ModifierInvocationContext): 114 | return self.visitChildren(ctx) 115 | 116 | 117 | # Visit a parse tree produced by SolidityParser#functionDefinition. 118 | def visitFunctionDefinition(self, ctx:SolidityParser.FunctionDefinitionContext): 119 | return self.visitChildren(ctx) 120 | 121 | 122 | # Visit a parse tree produced by SolidityParser#functionDescriptor. 123 | def visitFunctionDescriptor(self, ctx:SolidityParser.FunctionDescriptorContext): 124 | return self.visitChildren(ctx) 125 | 126 | 127 | # Visit a parse tree produced by SolidityParser#returnParameters. 128 | def visitReturnParameters(self, ctx:SolidityParser.ReturnParametersContext): 129 | return self.visitChildren(ctx) 130 | 131 | 132 | # Visit a parse tree produced by SolidityParser#modifierList. 133 | def visitModifierList(self, ctx:SolidityParser.ModifierListContext): 134 | return self.visitChildren(ctx) 135 | 136 | 137 | # Visit a parse tree produced by SolidityParser#eventDefinition. 138 | def visitEventDefinition(self, ctx:SolidityParser.EventDefinitionContext): 139 | return self.visitChildren(ctx) 140 | 141 | 142 | # Visit a parse tree produced by SolidityParser#enumValue. 143 | def visitEnumValue(self, ctx:SolidityParser.EnumValueContext): 144 | return self.visitChildren(ctx) 145 | 146 | 147 | # Visit a parse tree produced by SolidityParser#enumDefinition. 148 | def visitEnumDefinition(self, ctx:SolidityParser.EnumDefinitionContext): 149 | return self.visitChildren(ctx) 150 | 151 | 152 | # Visit a parse tree produced by SolidityParser#parameterList. 153 | def visitParameterList(self, ctx:SolidityParser.ParameterListContext): 154 | return self.visitChildren(ctx) 155 | 156 | 157 | # Visit a parse tree produced by SolidityParser#parameter. 158 | def visitParameter(self, ctx:SolidityParser.ParameterContext): 159 | return self.visitChildren(ctx) 160 | 161 | 162 | # Visit a parse tree produced by SolidityParser#eventParameterList. 163 | def visitEventParameterList(self, ctx:SolidityParser.EventParameterListContext): 164 | return self.visitChildren(ctx) 165 | 166 | 167 | # Visit a parse tree produced by SolidityParser#eventParameter. 168 | def visitEventParameter(self, ctx:SolidityParser.EventParameterContext): 169 | return self.visitChildren(ctx) 170 | 171 | 172 | # Visit a parse tree produced by SolidityParser#functionTypeParameterList. 173 | def visitFunctionTypeParameterList(self, ctx:SolidityParser.FunctionTypeParameterListContext): 174 | return self.visitChildren(ctx) 175 | 176 | 177 | # Visit a parse tree produced by SolidityParser#functionTypeParameter. 178 | def visitFunctionTypeParameter(self, ctx:SolidityParser.FunctionTypeParameterContext): 179 | return self.visitChildren(ctx) 180 | 181 | 182 | # Visit a parse tree produced by SolidityParser#variableDeclaration. 183 | def visitVariableDeclaration(self, ctx:SolidityParser.VariableDeclarationContext): 184 | return self.visitChildren(ctx) 185 | 186 | 187 | # Visit a parse tree produced by SolidityParser#typeName. 188 | def visitTypeName(self, ctx:SolidityParser.TypeNameContext): 189 | return self.visitChildren(ctx) 190 | 191 | 192 | # Visit a parse tree produced by SolidityParser#userDefinedTypeName. 193 | def visitUserDefinedTypeName(self, ctx:SolidityParser.UserDefinedTypeNameContext): 194 | return self.visitChildren(ctx) 195 | 196 | 197 | # Visit a parse tree produced by SolidityParser#mappingKey. 198 | def visitMappingKey(self, ctx:SolidityParser.MappingKeyContext): 199 | return self.visitChildren(ctx) 200 | 201 | 202 | # Visit a parse tree produced by SolidityParser#mapping. 203 | def visitMapping(self, ctx:SolidityParser.MappingContext): 204 | return self.visitChildren(ctx) 205 | 206 | 207 | # Visit a parse tree produced by SolidityParser#functionTypeName. 208 | def visitFunctionTypeName(self, ctx:SolidityParser.FunctionTypeNameContext): 209 | return self.visitChildren(ctx) 210 | 211 | 212 | # Visit a parse tree produced by SolidityParser#storageLocation. 213 | def visitStorageLocation(self, ctx:SolidityParser.StorageLocationContext): 214 | return self.visitChildren(ctx) 215 | 216 | 217 | # Visit a parse tree produced by SolidityParser#stateMutability. 218 | def visitStateMutability(self, ctx:SolidityParser.StateMutabilityContext): 219 | return self.visitChildren(ctx) 220 | 221 | 222 | # Visit a parse tree produced by SolidityParser#block. 223 | def visitBlock(self, ctx:SolidityParser.BlockContext): 224 | return self.visitChildren(ctx) 225 | 226 | 227 | # Visit a parse tree produced by SolidityParser#statement. 228 | def visitStatement(self, ctx:SolidityParser.StatementContext): 229 | return self.visitChildren(ctx) 230 | 231 | 232 | # Visit a parse tree produced by SolidityParser#expressionStatement. 233 | def visitExpressionStatement(self, ctx:SolidityParser.ExpressionStatementContext): 234 | return self.visitChildren(ctx) 235 | 236 | 237 | # Visit a parse tree produced by SolidityParser#ifStatement. 238 | def visitIfStatement(self, ctx:SolidityParser.IfStatementContext): 239 | return self.visitChildren(ctx) 240 | 241 | 242 | # Visit a parse tree produced by SolidityParser#tryStatement. 243 | def visitTryStatement(self, ctx:SolidityParser.TryStatementContext): 244 | return self.visitChildren(ctx) 245 | 246 | 247 | # Visit a parse tree produced by SolidityParser#catchClause. 248 | def visitCatchClause(self, ctx:SolidityParser.CatchClauseContext): 249 | return self.visitChildren(ctx) 250 | 251 | 252 | # Visit a parse tree produced by SolidityParser#whileStatement. 253 | def visitWhileStatement(self, ctx:SolidityParser.WhileStatementContext): 254 | return self.visitChildren(ctx) 255 | 256 | 257 | # Visit a parse tree produced by SolidityParser#simpleStatement. 258 | def visitSimpleStatement(self, ctx:SolidityParser.SimpleStatementContext): 259 | return self.visitChildren(ctx) 260 | 261 | 262 | # Visit a parse tree produced by SolidityParser#uncheckedStatement. 263 | def visitUncheckedStatement(self, ctx:SolidityParser.UncheckedStatementContext): 264 | return self.visitChildren(ctx) 265 | 266 | 267 | # Visit a parse tree produced by SolidityParser#forStatement. 268 | def visitForStatement(self, ctx:SolidityParser.ForStatementContext): 269 | return self.visitChildren(ctx) 270 | 271 | 272 | # Visit a parse tree produced by SolidityParser#inlineAssemblyStatement. 273 | def visitInlineAssemblyStatement(self, ctx:SolidityParser.InlineAssemblyStatementContext): 274 | return self.visitChildren(ctx) 275 | 276 | 277 | # Visit a parse tree produced by SolidityParser#doWhileStatement. 278 | def visitDoWhileStatement(self, ctx:SolidityParser.DoWhileStatementContext): 279 | return self.visitChildren(ctx) 280 | 281 | 282 | # Visit a parse tree produced by SolidityParser#continueStatement. 283 | def visitContinueStatement(self, ctx:SolidityParser.ContinueStatementContext): 284 | return self.visitChildren(ctx) 285 | 286 | 287 | # Visit a parse tree produced by SolidityParser#breakStatement. 288 | def visitBreakStatement(self, ctx:SolidityParser.BreakStatementContext): 289 | return self.visitChildren(ctx) 290 | 291 | 292 | # Visit a parse tree produced by SolidityParser#returnStatement. 293 | def visitReturnStatement(self, ctx:SolidityParser.ReturnStatementContext): 294 | return self.visitChildren(ctx) 295 | 296 | 297 | # Visit a parse tree produced by SolidityParser#throwStatement. 298 | def visitThrowStatement(self, ctx:SolidityParser.ThrowStatementContext): 299 | return self.visitChildren(ctx) 300 | 301 | 302 | # Visit a parse tree produced by SolidityParser#emitStatement. 303 | def visitEmitStatement(self, ctx:SolidityParser.EmitStatementContext): 304 | return self.visitChildren(ctx) 305 | 306 | 307 | # Visit a parse tree produced by SolidityParser#revertStatement. 308 | def visitRevertStatement(self, ctx:SolidityParser.RevertStatementContext): 309 | return self.visitChildren(ctx) 310 | 311 | 312 | # Visit a parse tree produced by SolidityParser#variableDeclarationStatement. 313 | def visitVariableDeclarationStatement(self, ctx:SolidityParser.VariableDeclarationStatementContext): 314 | return self.visitChildren(ctx) 315 | 316 | 317 | # Visit a parse tree produced by SolidityParser#variableDeclarationList. 318 | def visitVariableDeclarationList(self, ctx:SolidityParser.VariableDeclarationListContext): 319 | return self.visitChildren(ctx) 320 | 321 | 322 | # Visit a parse tree produced by SolidityParser#identifierList. 323 | def visitIdentifierList(self, ctx:SolidityParser.IdentifierListContext): 324 | return self.visitChildren(ctx) 325 | 326 | 327 | # Visit a parse tree produced by SolidityParser#elementaryTypeName. 328 | def visitElementaryTypeName(self, ctx:SolidityParser.ElementaryTypeNameContext): 329 | return self.visitChildren(ctx) 330 | 331 | 332 | # Visit a parse tree produced by SolidityParser#expression. 333 | def visitExpression(self, ctx:SolidityParser.ExpressionContext): 334 | return self.visitChildren(ctx) 335 | 336 | 337 | # Visit a parse tree produced by SolidityParser#primaryExpression. 338 | def visitPrimaryExpression(self, ctx:SolidityParser.PrimaryExpressionContext): 339 | return self.visitChildren(ctx) 340 | 341 | 342 | # Visit a parse tree produced by SolidityParser#expressionList. 343 | def visitExpressionList(self, ctx:SolidityParser.ExpressionListContext): 344 | return self.visitChildren(ctx) 345 | 346 | 347 | # Visit a parse tree produced by SolidityParser#nameValueList. 348 | def visitNameValueList(self, ctx:SolidityParser.NameValueListContext): 349 | return self.visitChildren(ctx) 350 | 351 | 352 | # Visit a parse tree produced by SolidityParser#nameValue. 353 | def visitNameValue(self, ctx:SolidityParser.NameValueContext): 354 | return self.visitChildren(ctx) 355 | 356 | 357 | # Visit a parse tree produced by SolidityParser#functionCallArguments. 358 | def visitFunctionCallArguments(self, ctx:SolidityParser.FunctionCallArgumentsContext): 359 | return self.visitChildren(ctx) 360 | 361 | 362 | # Visit a parse tree produced by SolidityParser#functionCall. 363 | def visitFunctionCall(self, ctx:SolidityParser.FunctionCallContext): 364 | return self.visitChildren(ctx) 365 | 366 | 367 | # Visit a parse tree produced by SolidityParser#assemblyBlock. 368 | def visitAssemblyBlock(self, ctx:SolidityParser.AssemblyBlockContext): 369 | return self.visitChildren(ctx) 370 | 371 | 372 | # Visit a parse tree produced by SolidityParser#assemblyItem. 373 | def visitAssemblyItem(self, ctx:SolidityParser.AssemblyItemContext): 374 | return self.visitChildren(ctx) 375 | 376 | 377 | # Visit a parse tree produced by SolidityParser#assemblyExpression. 378 | def visitAssemblyExpression(self, ctx:SolidityParser.AssemblyExpressionContext): 379 | return self.visitChildren(ctx) 380 | 381 | 382 | # Visit a parse tree produced by SolidityParser#assemblyMember. 383 | def visitAssemblyMember(self, ctx:SolidityParser.AssemblyMemberContext): 384 | return self.visitChildren(ctx) 385 | 386 | 387 | # Visit a parse tree produced by SolidityParser#assemblyCall. 388 | def visitAssemblyCall(self, ctx:SolidityParser.AssemblyCallContext): 389 | return self.visitChildren(ctx) 390 | 391 | 392 | # Visit a parse tree produced by SolidityParser#assemblyLocalDefinition. 393 | def visitAssemblyLocalDefinition(self, ctx:SolidityParser.AssemblyLocalDefinitionContext): 394 | return self.visitChildren(ctx) 395 | 396 | 397 | # Visit a parse tree produced by SolidityParser#assemblyAssignment. 398 | def visitAssemblyAssignment(self, ctx:SolidityParser.AssemblyAssignmentContext): 399 | return self.visitChildren(ctx) 400 | 401 | 402 | # Visit a parse tree produced by SolidityParser#assemblyIdentifierOrList. 403 | def visitAssemblyIdentifierOrList(self, ctx:SolidityParser.AssemblyIdentifierOrListContext): 404 | return self.visitChildren(ctx) 405 | 406 | 407 | # Visit a parse tree produced by SolidityParser#assemblyIdentifierList. 408 | def visitAssemblyIdentifierList(self, ctx:SolidityParser.AssemblyIdentifierListContext): 409 | return self.visitChildren(ctx) 410 | 411 | 412 | # Visit a parse tree produced by SolidityParser#assemblyStackAssignment. 413 | def visitAssemblyStackAssignment(self, ctx:SolidityParser.AssemblyStackAssignmentContext): 414 | return self.visitChildren(ctx) 415 | 416 | 417 | # Visit a parse tree produced by SolidityParser#labelDefinition. 418 | def visitLabelDefinition(self, ctx:SolidityParser.LabelDefinitionContext): 419 | return self.visitChildren(ctx) 420 | 421 | 422 | # Visit a parse tree produced by SolidityParser#assemblySwitch. 423 | def visitAssemblySwitch(self, ctx:SolidityParser.AssemblySwitchContext): 424 | return self.visitChildren(ctx) 425 | 426 | 427 | # Visit a parse tree produced by SolidityParser#assemblyCase. 428 | def visitAssemblyCase(self, ctx:SolidityParser.AssemblyCaseContext): 429 | return self.visitChildren(ctx) 430 | 431 | 432 | # Visit a parse tree produced by SolidityParser#assemblyFunctionDefinition. 433 | def visitAssemblyFunctionDefinition(self, ctx:SolidityParser.AssemblyFunctionDefinitionContext): 434 | return self.visitChildren(ctx) 435 | 436 | 437 | # Visit a parse tree produced by SolidityParser#assemblyFunctionReturns. 438 | def visitAssemblyFunctionReturns(self, ctx:SolidityParser.AssemblyFunctionReturnsContext): 439 | return self.visitChildren(ctx) 440 | 441 | 442 | # Visit a parse tree produced by SolidityParser#assemblyFor. 443 | def visitAssemblyFor(self, ctx:SolidityParser.AssemblyForContext): 444 | return self.visitChildren(ctx) 445 | 446 | 447 | # Visit a parse tree produced by SolidityParser#assemblyIf. 448 | def visitAssemblyIf(self, ctx:SolidityParser.AssemblyIfContext): 449 | return self.visitChildren(ctx) 450 | 451 | 452 | # Visit a parse tree produced by SolidityParser#assemblyLiteral. 453 | def visitAssemblyLiteral(self, ctx:SolidityParser.AssemblyLiteralContext): 454 | return self.visitChildren(ctx) 455 | 456 | 457 | # Visit a parse tree produced by SolidityParser#subAssembly. 458 | def visitSubAssembly(self, ctx:SolidityParser.SubAssemblyContext): 459 | return self.visitChildren(ctx) 460 | 461 | 462 | # Visit a parse tree produced by SolidityParser#tupleExpression. 463 | def visitTupleExpression(self, ctx:SolidityParser.TupleExpressionContext): 464 | return self.visitChildren(ctx) 465 | 466 | 467 | # Visit a parse tree produced by SolidityParser#typeNameExpression. 468 | def visitTypeNameExpression(self, ctx:SolidityParser.TypeNameExpressionContext): 469 | return self.visitChildren(ctx) 470 | 471 | 472 | # Visit a parse tree produced by SolidityParser#numberLiteral. 473 | def visitNumberLiteral(self, ctx:SolidityParser.NumberLiteralContext): 474 | return self.visitChildren(ctx) 475 | 476 | 477 | # Visit a parse tree produced by SolidityParser#identifier. 478 | def visitIdentifier(self, ctx:SolidityParser.IdentifierContext): 479 | return self.visitChildren(ctx) 480 | 481 | 482 | # Visit a parse tree produced by SolidityParser#hexLiteral. 483 | def visitHexLiteral(self, ctx:SolidityParser.HexLiteralContext): 484 | return self.visitChildren(ctx) 485 | 486 | 487 | # Visit a parse tree produced by SolidityParser#overrideSpecifier. 488 | def visitOverrideSpecifier(self, ctx:SolidityParser.OverrideSpecifierContext): 489 | return self.visitChildren(ctx) 490 | 491 | 492 | # Visit a parse tree produced by SolidityParser#stringLiteral. 493 | def visitStringLiteral(self, ctx:SolidityParser.StringLiteralContext): 494 | return self.visitChildren(ctx) 495 | 496 | 497 | 498 | del SolidityParser -------------------------------------------------------------------------------- /solidity_parser/solidity_antlr4/__AUTOGENERATED__: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ConsenSysDiligence/python-solidity-parser/5b0977c4a986f0177260f315e77d77d26a2c6510/solidity_parser/solidity_antlr4/__AUTOGENERATED__ -------------------------------------------------------------------------------- /solidity_parser/solidity_antlr4/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ConsenSysDiligence/python-solidity-parser/5b0977c4a986f0177260f315e77d77d26a2c6510/solidity_parser/solidity_antlr4/__init__.py --------------------------------------------------------------------------------