__init__.py000064400000005546147205113120006663 0ustar00#----------------------------------------------------------------- # pycparser: __init__.py # # This package file exports some convenience functions for # interacting with pycparser # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- __all__ = ['c_lexer', 'c_parser', 'c_ast'] __version__ = '2.22' import io from subprocess import check_output from .c_parser import CParser def preprocess_file(filename, cpp_path='cpp', cpp_args=''): """ Preprocess a file using cpp. filename: Name of the file you want to preprocess. cpp_path: cpp_args: Refer to the documentation of parse_file for the meaning of these arguments. When successful, returns the preprocessed file's contents. Errors from cpp will be printed out. """ path_list = [cpp_path] if isinstance(cpp_args, list): path_list += cpp_args elif cpp_args != '': path_list += [cpp_args] path_list += [filename] try: # Note the use of universal_newlines to treat all newlines # as \n for Python's purpose text = check_output(path_list, universal_newlines=True) except OSError as e: raise RuntimeError("Unable to invoke 'cpp'. " + 'Make sure its path was passed correctly\n' + ('Original error: %s' % e)) return text def parse_file(filename, use_cpp=False, cpp_path='cpp', cpp_args='', parser=None, encoding=None): """ Parse a C file using pycparser. filename: Name of the file you want to parse. use_cpp: Set to True if you want to execute the C pre-processor on the file prior to parsing it. cpp_path: If use_cpp is True, this is the path to 'cpp' on your system. If no path is provided, it attempts to just execute 'cpp', so it must be in your PATH. cpp_args: If use_cpp is True, set this to the command line arguments strings to cpp. Be careful with quotes - it's best to pass a raw string (r'') here. For example: r'-I../utils/fake_libc_include' If several arguments are required, pass a list of strings. encoding: Encoding to use for the file to parse parser: Optional parser object to be used instead of the default CParser When successful, an AST is returned. ParseError can be thrown if the file doesn't parse successfully. Errors from cpp will be printed out. """ if use_cpp: text = preprocess_file(filename, cpp_path, cpp_args) else: with io.open(filename, encoding=encoding) as f: text = f.read() if parser is None: parser = CParser() return parser.parse(text, filename) _ast_gen.py000064400000024473147205113120006703 0ustar00#----------------------------------------------------------------- # _ast_gen.py # # Generates the AST Node classes from a specification given in # a configuration file # # The design of this module was inspired by astgen.py from the # Python 2.5 code-base. # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- from string import Template class ASTCodeGenerator(object): def __init__(self, cfg_filename='_c_ast.cfg'): """ Initialize the code generator from a configuration file. """ self.cfg_filename = cfg_filename self.node_cfg = [NodeCfg(name, contents) for (name, contents) in self.parse_cfgfile(cfg_filename)] def generate(self, file=None): """ Generates the code into file, an open file buffer. """ src = Template(_PROLOGUE_COMMENT).substitute( cfg_filename=self.cfg_filename) src += _PROLOGUE_CODE for node_cfg in self.node_cfg: src += node_cfg.generate_source() + '\n\n' file.write(src) def parse_cfgfile(self, filename): """ Parse the configuration file and yield pairs of (name, contents) for each node. """ with open(filename, "r") as f: for line in f: line = line.strip() if not line or line.startswith('#'): continue colon_i = line.find(':') lbracket_i = line.find('[') rbracket_i = line.find(']') if colon_i < 1 or lbracket_i <= colon_i or rbracket_i <= lbracket_i: raise RuntimeError("Invalid line in %s:\n%s\n" % (filename, line)) name = line[:colon_i] val = line[lbracket_i + 1:rbracket_i] vallist = [v.strip() for v in val.split(',')] if val else [] yield name, vallist class NodeCfg(object): """ Node configuration. name: node name contents: a list of contents - attributes and child nodes See comment at the top of the configuration file for details. """ def __init__(self, name, contents): self.name = name self.all_entries = [] self.attr = [] self.child = [] self.seq_child = [] for entry in contents: clean_entry = entry.rstrip('*') self.all_entries.append(clean_entry) if entry.endswith('**'): self.seq_child.append(clean_entry) elif entry.endswith('*'): self.child.append(clean_entry) else: self.attr.append(entry) def generate_source(self): src = self._gen_init() src += '\n' + self._gen_children() src += '\n' + self._gen_iter() src += '\n' + self._gen_attr_names() return src def _gen_init(self): src = "class %s(Node):\n" % self.name if self.all_entries: args = ', '.join(self.all_entries) slots = ', '.join("'{0}'".format(e) for e in self.all_entries) slots += ", 'coord', '__weakref__'" arglist = '(self, %s, coord=None)' % args else: slots = "'coord', '__weakref__'" arglist = '(self, coord=None)' src += " __slots__ = (%s)\n" % slots src += " def __init__%s:\n" % arglist for name in self.all_entries + ['coord']: src += " self.%s = %s\n" % (name, name) return src def _gen_children(self): src = ' def children(self):\n' if self.all_entries: src += ' nodelist = []\n' for child in self.child: src += ( ' if self.%(child)s is not None:' + ' nodelist.append(("%(child)s", self.%(child)s))\n') % ( dict(child=child)) for seq_child in self.seq_child: src += ( ' for i, child in enumerate(self.%(child)s or []):\n' ' nodelist.append(("%(child)s[%%d]" %% i, child))\n') % ( dict(child=seq_child)) src += ' return tuple(nodelist)\n' else: src += ' return ()\n' return src def _gen_iter(self): src = ' def __iter__(self):\n' if self.all_entries: for child in self.child: src += ( ' if self.%(child)s is not None:\n' + ' yield self.%(child)s\n') % (dict(child=child)) for seq_child in self.seq_child: src += ( ' for child in (self.%(child)s or []):\n' ' yield child\n') % (dict(child=seq_child)) if not (self.child or self.seq_child): # Empty generator src += ( ' return\n' + ' yield\n') else: # Empty generator src += ( ' return\n' + ' yield\n') return src def _gen_attr_names(self): src = " attr_names = (" + ''.join("%r, " % nm for nm in self.attr) + ')' return src _PROLOGUE_COMMENT = \ r'''#----------------------------------------------------------------- # ** ATTENTION ** # This code was automatically generated from the file: # $cfg_filename # # Do not modify it directly. Modify the configuration file and # run the generator again. # ** ** *** ** ** # # pycparser: c_ast.py # # AST Node classes. # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- ''' _PROLOGUE_CODE = r''' import sys def _repr(obj): """ Get the representation of an object, with dedicated pprint-like format for lists. """ if isinstance(obj, list): return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' else: return repr(obj) class Node(object): __slots__ = () """ Abstract base class for AST nodes. """ def __repr__(self): """ Generates a python representation of the current node """ result = self.__class__.__name__ + '(' indent = '' separator = '' for name in self.__slots__[:-2]: result += separator result += indent result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) separator = ',' indent = '\n ' + (' ' * len(self.__class__.__name__)) result += indent + ')' return result def children(self): """ A sequence of all children that are Nodes """ pass def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None): """ Pretty print the Node and all its attributes and children (recursively) to a buffer. buf: Open IO buffer into which the Node is printed. offset: Initial offset (amount of leading spaces) attrnames: True if you want to see the attribute names in name=value pairs. False to only see the values. nodenames: True if you want to see the actual node names within their parents. showcoord: Do you want the coordinates of each Node to be displayed. """ lead = ' ' * offset if nodenames and _my_node_name is not None: buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ') else: buf.write(lead + self.__class__.__name__+ ': ') if self.attr_names: if attrnames: nvlist = [(n, getattr(self,n)) for n in self.attr_names] attrstr = ', '.join('%s=%s' % nv for nv in nvlist) else: vlist = [getattr(self, n) for n in self.attr_names] attrstr = ', '.join('%s' % v for v in vlist) buf.write(attrstr) if showcoord: buf.write(' (at %s)' % self.coord) buf.write('\n') for (child_name, child) in self.children(): child.show( buf, offset=offset + 2, attrnames=attrnames, nodenames=nodenames, showcoord=showcoord, _my_node_name=child_name) class NodeVisitor(object): """ A base NodeVisitor class for visiting c_ast nodes. Subclass it and define your own visit_XXX methods, where XXX is the class name you want to visit with these methods. For example: class ConstantVisitor(NodeVisitor): def __init__(self): self.values = [] def visit_Constant(self, node): self.values.append(node.value) Creates a list of values of all the constant nodes encountered below the given node. To use it: cv = ConstantVisitor() cv.visit(node) Notes: * generic_visit() will be called for AST nodes for which no visit_XXX method was defined. * The children of nodes for which a visit_XXX was defined will not be visited - if you need this, call generic_visit() on the node. You can use: NodeVisitor.generic_visit(self, node) * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) """ _method_cache = None def visit(self, node): """ Visit a node. """ if self._method_cache is None: self._method_cache = {} visitor = self._method_cache.get(node.__class__.__name__, None) if visitor is None: method = 'visit_' + node.__class__.__name__ visitor = getattr(self, method, self.generic_visit) self._method_cache[node.__class__.__name__] = visitor return visitor(node) def generic_visit(self, node): """ Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. """ for c in node: self.visit(c) ''' _build_tables.py000064400000002077147205113120007710 0ustar00#----------------------------------------------------------------- # pycparser: _build_tables.py # # A dummy for generating the lexing/parsing tables and and # compiling them into .pyc for faster execution in optimized mode. # Also generates AST code from the configuration file. # Should be called from the pycparser directory. # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- # Insert '.' and '..' as first entries to the search path for modules. # Restricted environments like embeddable python do not include the # current working directory on startup. import importlib import sys sys.path[0:0] = ['.', '..'] # Generate c_ast.py from _ast_gen import ASTCodeGenerator ast_gen = ASTCodeGenerator('_c_ast.cfg') ast_gen.generate(open('c_ast.py', 'w')) from pycparser import c_parser # Generates the tables # c_parser.CParser( lex_optimize=True, yacc_debug=False, yacc_optimize=True) # Load to compile into .pyc # importlib.invalidate_caches() import lextab import yacctab import c_ast _c_ast.cfg000064400000010237147205113120006454 0ustar00#----------------------------------------------------------------- # pycparser: _c_ast.cfg # # Defines the AST Node classes used in pycparser. # # Each entry is a Node sub-class name, listing the attributes # and child nodes of the class: # * - a child node # ** - a sequence of child nodes # - an attribute # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- # ArrayDecl is a nested declaration of an array with the given type. # dim: the dimension (for example, constant 42) # dim_quals: list of dimension qualifiers, to support C99's allowing 'const' # and 'static' within the array dimension in function declarations. ArrayDecl: [type*, dim*, dim_quals] ArrayRef: [name*, subscript*] # op: =, +=, /= etc. # Assignment: [op, lvalue*, rvalue*] Alignas: [alignment*] BinaryOp: [op, left*, right*] Break: [] Case: [expr*, stmts**] Cast: [to_type*, expr*] # Compound statement in C99 is a list of block items (declarations or # statements). # Compound: [block_items**] # Compound literal (anonymous aggregate) for C99. # (type-name) {initializer_list} # type: the typename # init: InitList for the initializer list # CompoundLiteral: [type*, init*] # type: int, char, float, string, etc. # Constant: [type, value] Continue: [] # name: the variable being declared # quals: list of qualifiers (const, volatile) # funcspec: list function specifiers (i.e. inline in C99) # storage: list of storage specifiers (extern, register, etc.) # type: declaration type (probably nested with all the modifiers) # init: initialization value, or None # bitsize: bit field size, or None # Decl: [name, quals, align, storage, funcspec, type*, init*, bitsize*] DeclList: [decls**] Default: [stmts**] DoWhile: [cond*, stmt*] # Represents the ellipsis (...) parameter in a function # declaration # EllipsisParam: [] # An empty statement (a semicolon ';' on its own) # EmptyStatement: [] # Enumeration type specifier # name: an optional ID # values: an EnumeratorList # Enum: [name, values*] # A name/value pair for enumeration values # Enumerator: [name, value*] # A list of enumerators # EnumeratorList: [enumerators**] # A list of expressions separated by the comma operator. # ExprList: [exprs**] # This is the top of the AST, representing a single C file (a # translation unit in K&R jargon). It contains a list of # "external-declaration"s, which is either declarations (Decl), # Typedef or function definitions (FuncDef). # FileAST: [ext**] # for (init; cond; next) stmt # For: [init*, cond*, next*, stmt*] # name: Id # args: ExprList # FuncCall: [name*, args*] # type (args) # FuncDecl: [args*, type*] # Function definition: a declarator for the function name and # a body, which is a compound statement. # There's an optional list of parameter declarations for old # K&R-style definitions # FuncDef: [decl*, param_decls**, body*] Goto: [name] ID: [name] # Holder for types that are a simple identifier (e.g. the built # ins void, char etc. and typedef-defined types) # IdentifierType: [names] If: [cond*, iftrue*, iffalse*] # An initialization list used for compound literals. # InitList: [exprs**] Label: [name, stmt*] # A named initializer for C99. # The name of a NamedInitializer is a sequence of Nodes, because # names can be hierarchical and contain constant expressions. # NamedInitializer: [name**, expr*] # a list of comma separated function parameter declarations # ParamList: [params**] PtrDecl: [quals, type*] Return: [expr*] StaticAssert: [cond*, message*] # name: struct tag name # decls: declaration of members # Struct: [name, decls**] # type: . or -> # name.field or name->field # StructRef: [name*, type, field*] Switch: [cond*, stmt*] # cond ? iftrue : iffalse # TernaryOp: [cond*, iftrue*, iffalse*] # A base type declaration # TypeDecl: [declname, quals, align, type*] # A typedef declaration. # Very similar to Decl, but without some attributes # Typedef: [name, quals, storage, type*] Typename: [name, quals, align, type*] UnaryOp: [op, expr*] # name: union tag name # decls: declaration of members # Union: [name, decls**] While: [cond*, stmt*] Pragma: [string] ast_transforms.py000064400000013073147205113120010163 0ustar00#------------------------------------------------------------------------------ # pycparser: ast_transforms.py # # Some utilities used by the parser to create a friendlier AST. # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ from . import c_ast def fix_switch_cases(switch_node): """ The 'case' statements in a 'switch' come out of parsing with one child node, so subsequent statements are just tucked to the parent Compound. Additionally, consecutive (fall-through) case statements come out messy. This is a peculiarity of the C grammar. The following: switch (myvar) { case 10: k = 10; p = k + 1; return 10; case 20: case 30: return 20; default: break; } Creates this tree (pseudo-dump): Switch ID: myvar Compound: Case 10: k = 10 p = k + 1 return 10 Case 20: Case 30: return 20 Default: break The goal of this transform is to fix this mess, turning it into the following: Switch ID: myvar Compound: Case 10: k = 10 p = k + 1 return 10 Case 20: Case 30: return 20 Default: break A fixed AST node is returned. The argument may be modified. """ assert isinstance(switch_node, c_ast.Switch) if not isinstance(switch_node.stmt, c_ast.Compound): return switch_node # The new Compound child for the Switch, which will collect children in the # correct order new_compound = c_ast.Compound([], switch_node.stmt.coord) # The last Case/Default node last_case = None # Goes over the children of the Compound below the Switch, adding them # either directly below new_compound or below the last Case as appropriate # (for `switch(cond) {}`, block_items would have been None) for child in (switch_node.stmt.block_items or []): if isinstance(child, (c_ast.Case, c_ast.Default)): # If it's a Case/Default: # 1. Add it to the Compound and mark as "last case" # 2. If its immediate child is also a Case or Default, promote it # to a sibling. new_compound.block_items.append(child) _extract_nested_case(child, new_compound.block_items) last_case = new_compound.block_items[-1] else: # Other statements are added as children to the last case, if it # exists. if last_case is None: new_compound.block_items.append(child) else: last_case.stmts.append(child) switch_node.stmt = new_compound return switch_node def _extract_nested_case(case_node, stmts_list): """ Recursively extract consecutive Case statements that are made nested by the parser and add them to the stmts_list. """ if isinstance(case_node.stmts[0], (c_ast.Case, c_ast.Default)): stmts_list.append(case_node.stmts.pop()) _extract_nested_case(stmts_list[-1], stmts_list) def fix_atomic_specifiers(decl): """ Atomic specifiers like _Atomic(type) are unusually structured, conferring a qualifier upon the contained type. This function fixes a decl with atomic specifiers to have a sane AST structure, by removing spurious Typename->TypeDecl pairs and attaching the _Atomic qualifier in the right place. """ # There can be multiple levels of _Atomic in a decl; fix them until a # fixed point is reached. while True: decl, found = _fix_atomic_specifiers_once(decl) if not found: break # Make sure to add an _Atomic qual on the topmost decl if needed. Also # restore the declname on the innermost TypeDecl (it gets placed in the # wrong place during construction). typ = decl while not isinstance(typ, c_ast.TypeDecl): try: typ = typ.type except AttributeError: return decl if '_Atomic' in typ.quals and '_Atomic' not in decl.quals: decl.quals.append('_Atomic') if typ.declname is None: typ.declname = decl.name return decl def _fix_atomic_specifiers_once(decl): """ Performs one 'fix' round of atomic specifiers. Returns (modified_decl, found) where found is True iff a fix was made. """ parent = decl grandparent = None node = decl.type while node is not None: if isinstance(node, c_ast.Typename) and '_Atomic' in node.quals: break try: grandparent = parent parent = node node = node.type except AttributeError: # If we've reached a node without a `type` field, it means we won't # find what we're looking for at this point; give up the search # and return the original decl unmodified. return decl, False assert isinstance(parent, c_ast.TypeDecl) grandparent.type = node.type if '_Atomic' not in node.type.quals: node.type.quals.append('_Atomic') return decl, True c_ast.py000064400000075325147205113120006217 0ustar00#----------------------------------------------------------------- # ** ATTENTION ** # This code was automatically generated from the file: # _c_ast.cfg # # Do not modify it directly. Modify the configuration file and # run the generator again. # ** ** *** ** ** # # pycparser: c_ast.py # # AST Node classes. # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- import sys def _repr(obj): """ Get the representation of an object, with dedicated pprint-like format for lists. """ if isinstance(obj, list): return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' else: return repr(obj) class Node(object): __slots__ = () """ Abstract base class for AST nodes. """ def __repr__(self): """ Generates a python representation of the current node """ result = self.__class__.__name__ + '(' indent = '' separator = '' for name in self.__slots__[:-2]: result += separator result += indent result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) separator = ',' indent = '\n ' + (' ' * len(self.__class__.__name__)) result += indent + ')' return result def children(self): """ A sequence of all children that are Nodes """ pass def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None): """ Pretty print the Node and all its attributes and children (recursively) to a buffer. buf: Open IO buffer into which the Node is printed. offset: Initial offset (amount of leading spaces) attrnames: True if you want to see the attribute names in name=value pairs. False to only see the values. nodenames: True if you want to see the actual node names within their parents. showcoord: Do you want the coordinates of each Node to be displayed. """ lead = ' ' * offset if nodenames and _my_node_name is not None: buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ') else: buf.write(lead + self.__class__.__name__+ ': ') if self.attr_names: if attrnames: nvlist = [(n, getattr(self,n)) for n in self.attr_names] attrstr = ', '.join('%s=%s' % nv for nv in nvlist) else: vlist = [getattr(self, n) for n in self.attr_names] attrstr = ', '.join('%s' % v for v in vlist) buf.write(attrstr) if showcoord: buf.write(' (at %s)' % self.coord) buf.write('\n') for (child_name, child) in self.children(): child.show( buf, offset=offset + 2, attrnames=attrnames, nodenames=nodenames, showcoord=showcoord, _my_node_name=child_name) class NodeVisitor(object): """ A base NodeVisitor class for visiting c_ast nodes. Subclass it and define your own visit_XXX methods, where XXX is the class name you want to visit with these methods. For example: class ConstantVisitor(NodeVisitor): def __init__(self): self.values = [] def visit_Constant(self, node): self.values.append(node.value) Creates a list of values of all the constant nodes encountered below the given node. To use it: cv = ConstantVisitor() cv.visit(node) Notes: * generic_visit() will be called for AST nodes for which no visit_XXX method was defined. * The children of nodes for which a visit_XXX was defined will not be visited - if you need this, call generic_visit() on the node. You can use: NodeVisitor.generic_visit(self, node) * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) """ _method_cache = None def visit(self, node): """ Visit a node. """ if self._method_cache is None: self._method_cache = {} visitor = self._method_cache.get(node.__class__.__name__, None) if visitor is None: method = 'visit_' + node.__class__.__name__ visitor = getattr(self, method, self.generic_visit) self._method_cache[node.__class__.__name__] = visitor return visitor(node) def generic_visit(self, node): """ Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. """ for c in node: self.visit(c) class ArrayDecl(Node): __slots__ = ('type', 'dim', 'dim_quals', 'coord', '__weakref__') def __init__(self, type, dim, dim_quals, coord=None): self.type = type self.dim = dim self.dim_quals = dim_quals self.coord = coord def children(self): nodelist = [] if self.type is not None: nodelist.append(("type", self.type)) if self.dim is not None: nodelist.append(("dim", self.dim)) return tuple(nodelist) def __iter__(self): if self.type is not None: yield self.type if self.dim is not None: yield self.dim attr_names = ('dim_quals', ) class ArrayRef(Node): __slots__ = ('name', 'subscript', 'coord', '__weakref__') def __init__(self, name, subscript, coord=None): self.name = name self.subscript = subscript self.coord = coord def children(self): nodelist = [] if self.name is not None: nodelist.append(("name", self.name)) if self.subscript is not None: nodelist.append(("subscript", self.subscript)) return tuple(nodelist) def __iter__(self): if self.name is not None: yield self.name if self.subscript is not None: yield self.subscript attr_names = () class Assignment(Node): __slots__ = ('op', 'lvalue', 'rvalue', 'coord', '__weakref__') def __init__(self, op, lvalue, rvalue, coord=None): self.op = op self.lvalue = lvalue self.rvalue = rvalue self.coord = coord def children(self): nodelist = [] if self.lvalue is not None: nodelist.append(("lvalue", self.lvalue)) if self.rvalue is not None: nodelist.append(("rvalue", self.rvalue)) return tuple(nodelist) def __iter__(self): if self.lvalue is not None: yield self.lvalue if self.rvalue is not None: yield self.rvalue attr_names = ('op', ) class Alignas(Node): __slots__ = ('alignment', 'coord', '__weakref__') def __init__(self, alignment, coord=None): self.alignment = alignment self.coord = coord def children(self): nodelist = [] if self.alignment is not None: nodelist.append(("alignment", self.alignment)) return tuple(nodelist) def __iter__(self): if self.alignment is not None: yield self.alignment attr_names = () class BinaryOp(Node): __slots__ = ('op', 'left', 'right', 'coord', '__weakref__') def __init__(self, op, left, right, coord=None): self.op = op self.left = left self.right = right self.coord = coord def children(self): nodelist = [] if self.left is not None: nodelist.append(("left", self.left)) if self.right is not None: nodelist.append(("right", self.right)) return tuple(nodelist) def __iter__(self): if self.left is not None: yield self.left if self.right is not None: yield self.right attr_names = ('op', ) class Break(Node): __slots__ = ('coord', '__weakref__') def __init__(self, coord=None): self.coord = coord def children(self): return () def __iter__(self): return yield attr_names = () class Case(Node): __slots__ = ('expr', 'stmts', 'coord', '__weakref__') def __init__(self, expr, stmts, coord=None): self.expr = expr self.stmts = stmts self.coord = coord def children(self): nodelist = [] if self.expr is not None: nodelist.append(("expr", self.expr)) for i, child in enumerate(self.stmts or []): nodelist.append(("stmts[%d]" % i, child)) return tuple(nodelist) def __iter__(self): if self.expr is not None: yield self.expr for child in (self.stmts or []): yield child attr_names = () class Cast(Node): __slots__ = ('to_type', 'expr', 'coord', '__weakref__') def __init__(self, to_type, expr, coord=None): self.to_type = to_type self.expr = expr self.coord = coord def children(self): nodelist = [] if self.to_type is not None: nodelist.append(("to_type", self.to_type)) if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) def __iter__(self): if self.to_type is not None: yield self.to_type if self.expr is not None: yield self.expr attr_names = () class Compound(Node): __slots__ = ('block_items', 'coord', '__weakref__') def __init__(self, block_items, coord=None): self.block_items = block_items self.coord = coord def children(self): nodelist = [] for i, child in enumerate(self.block_items or []): nodelist.append(("block_items[%d]" % i, child)) return tuple(nodelist) def __iter__(self): for child in (self.block_items or []): yield child attr_names = () class CompoundLiteral(Node): __slots__ = ('type', 'init', 'coord', '__weakref__') def __init__(self, type, init, coord=None): self.type = type self.init = init self.coord = coord def children(self): nodelist = [] if self.type is not None: nodelist.append(("type", self.type)) if self.init is not None: nodelist.append(("init", self.init)) return tuple(nodelist) def __iter__(self): if self.type is not None: yield self.type if self.init is not None: yield self.init attr_names = () class Constant(Node): __slots__ = ('type', 'value', 'coord', '__weakref__') def __init__(self, type, value, coord=None): self.type = type self.value = value self.coord = coord def children(self): nodelist = [] return tuple(nodelist) def __iter__(self): return yield attr_names = ('type', 'value', ) class Continue(Node): __slots__ = ('coord', '__weakref__') def __init__(self, coord=None): self.coord = coord def children(self): return () def __iter__(self): return yield attr_names = () class Decl(Node): __slots__ = ('name', 'quals', 'align', 'storage', 'funcspec', 'type', 'init', 'bitsize', 'coord', '__weakref__') def __init__(self, name, quals, align, storage, funcspec, type, init, bitsize, coord=None): self.name = name self.quals = quals self.align = align self.storage = storage self.funcspec = funcspec self.type = type self.init = init self.bitsize = bitsize self.coord = coord def children(self): nodelist = [] if self.type is not None: nodelist.append(("type", self.type)) if self.init is not None: nodelist.append(("init", self.init)) if self.bitsize is not None: nodelist.append(("bitsize", self.bitsize)) return tuple(nodelist) def __iter__(self): if self.type is not None: yield self.type if self.init is not None: yield self.init if self.bitsize is not None: yield self.bitsize attr_names = ('name', 'quals', 'align', 'storage', 'funcspec', ) class DeclList(Node): __slots__ = ('decls', 'coord', '__weakref__') def __init__(self, decls, coord=None): self.decls = decls self.coord = coord def children(self): nodelist = [] for i, child in enumerate(self.decls or []): nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) def __iter__(self): for child in (self.decls or []): yield child attr_names = () class Default(Node): __slots__ = ('stmts', 'coord', '__weakref__') def __init__(self, stmts, coord=None): self.stmts = stmts self.coord = coord def children(self): nodelist = [] for i, child in enumerate(self.stmts or []): nodelist.append(("stmts[%d]" % i, child)) return tuple(nodelist) def __iter__(self): for child in (self.stmts or []): yield child attr_names = () class DoWhile(Node): __slots__ = ('cond', 'stmt', 'coord', '__weakref__') def __init__(self, cond, stmt, coord=None): self.cond = cond self.stmt = stmt self.coord = coord def children(self): nodelist = [] if self.cond is not None: nodelist.append(("cond", self.cond)) if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) def __iter__(self): if self.cond is not None: yield self.cond if self.stmt is not None: yield self.stmt attr_names = () class EllipsisParam(Node): __slots__ = ('coord', '__weakref__') def __init__(self, coord=None): self.coord = coord def children(self): return () def __iter__(self): return yield attr_names = () class EmptyStatement(Node): __slots__ = ('coord', '__weakref__') def __init__(self, coord=None): self.coord = coord def children(self): return () def __iter__(self): return yield attr_names = () class Enum(Node): __slots__ = ('name', 'values', 'coord', '__weakref__') def __init__(self, name, values, coord=None): self.name = name self.values = values self.coord = coord def children(self): nodelist = [] if self.values is not None: nodelist.append(("values", self.values)) return tuple(nodelist) def __iter__(self): if self.values is not None: yield self.values attr_names = ('name', ) class Enumerator(Node): __slots__ = ('name', 'value', 'coord', '__weakref__') def __init__(self, name, value, coord=None): self.name = name self.value = value self.coord = coord def children(self): nodelist = [] if self.value is not None: nodelist.append(("value", self.value)) return tuple(nodelist) def __iter__(self): if self.value is not None: yield self.value attr_names = ('name', ) class EnumeratorList(Node): __slots__ = ('enumerators', 'coord', '__weakref__') def __init__(self, enumerators, coord=None): self.enumerators = enumerators self.coord = coord def children(self): nodelist = [] for i, child in enumerate(self.enumerators or []): nodelist.append(("enumerators[%d]" % i, child)) return tuple(nodelist) def __iter__(self): for child in (self.enumerators or []): yield child attr_names = () class ExprList(Node): __slots__ = ('exprs', 'coord', '__weakref__') def __init__(self, exprs, coord=None): self.exprs = exprs self.coord = coord def children(self): nodelist = [] for i, child in enumerate(self.exprs or []): nodelist.append(("exprs[%d]" % i, child)) return tuple(nodelist) def __iter__(self): for child in (self.exprs or []): yield child attr_names = () class FileAST(Node): __slots__ = ('ext', 'coord', '__weakref__') def __init__(self, ext, coord=None): self.ext = ext self.coord = coord def children(self): nodelist = [] for i, child in enumerate(self.ext or []): nodelist.append(("ext[%d]" % i, child)) return tuple(nodelist) def __iter__(self): for child in (self.ext or []): yield child attr_names = () class For(Node): __slots__ = ('init', 'cond', 'next', 'stmt', 'coord', '__weakref__') def __init__(self, init, cond, next, stmt, coord=None): self.init = init self.cond = cond self.next = next self.stmt = stmt self.coord = coord def children(self): nodelist = [] if self.init is not None: nodelist.append(("init", self.init)) if self.cond is not None: nodelist.append(("cond", self.cond)) if self.next is not None: nodelist.append(("next", self.next)) if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) def __iter__(self): if self.init is not None: yield self.init if self.cond is not None: yield self.cond if self.next is not None: yield self.next if self.stmt is not None: yield self.stmt attr_names = () class FuncCall(Node): __slots__ = ('name', 'args', 'coord', '__weakref__') def __init__(self, name, args, coord=None): self.name = name self.args = args self.coord = coord def children(self): nodelist = [] if self.name is not None: nodelist.append(("name", self.name)) if self.args is not None: nodelist.append(("args", self.args)) return tuple(nodelist) def __iter__(self): if self.name is not None: yield self.name if self.args is not None: yield self.args attr_names = () class FuncDecl(Node): __slots__ = ('args', 'type', 'coord', '__weakref__') def __init__(self, args, type, coord=None): self.args = args self.type = type self.coord = coord def children(self): nodelist = [] if self.args is not None: nodelist.append(("args", self.args)) if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) def __iter__(self): if self.args is not None: yield self.args if self.type is not None: yield self.type attr_names = () class FuncDef(Node): __slots__ = ('decl', 'param_decls', 'body', 'coord', '__weakref__') def __init__(self, decl, param_decls, body, coord=None): self.decl = decl self.param_decls = param_decls self.body = body self.coord = coord def children(self): nodelist = [] if self.decl is not None: nodelist.append(("decl", self.decl)) if self.body is not None: nodelist.append(("body", self.body)) for i, child in enumerate(self.param_decls or []): nodelist.append(("param_decls[%d]" % i, child)) return tuple(nodelist) def __iter__(self): if self.decl is not None: yield self.decl if self.body is not None: yield self.body for child in (self.param_decls or []): yield child attr_names = () class Goto(Node): __slots__ = ('name', 'coord', '__weakref__') def __init__(self, name, coord=None): self.name = name self.coord = coord def children(self): nodelist = [] return tuple(nodelist) def __iter__(self): return yield attr_names = ('name', ) class ID(Node): __slots__ = ('name', 'coord', '__weakref__') def __init__(self, name, coord=None): self.name = name self.coord = coord def children(self): nodelist = [] return tuple(nodelist) def __iter__(self): return yield attr_names = ('name', ) class IdentifierType(Node): __slots__ = ('names', 'coord', '__weakref__') def __init__(self, names, coord=None): self.names = names self.coord = coord def children(self): nodelist = [] return tuple(nodelist) def __iter__(self): return yield attr_names = ('names', ) class If(Node): __slots__ = ('cond', 'iftrue', 'iffalse', 'coord', '__weakref__') def __init__(self, cond, iftrue, iffalse, coord=None): self.cond = cond self.iftrue = iftrue self.iffalse = iffalse self.coord = coord def children(self): nodelist = [] if self.cond is not None: nodelist.append(("cond", self.cond)) if self.iftrue is not None: nodelist.append(("iftrue", self.iftrue)) if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) return tuple(nodelist) def __iter__(self): if self.cond is not None: yield self.cond if self.iftrue is not None: yield self.iftrue if self.iffalse is not None: yield self.iffalse attr_names = () class InitList(Node): __slots__ = ('exprs', 'coord', '__weakref__') def __init__(self, exprs, coord=None): self.exprs = exprs self.coord = coord def children(self): nodelist = [] for i, child in enumerate(self.exprs or []): nodelist.append(("exprs[%d]" % i, child)) return tuple(nodelist) def __iter__(self): for child in (self.exprs or []): yield child attr_names = () class Label(Node): __slots__ = ('name', 'stmt', 'coord', '__weakref__') def __init__(self, name, stmt, coord=None): self.name = name self.stmt = stmt self.coord = coord def children(self): nodelist = [] if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) def __iter__(self): if self.stmt is not None: yield self.stmt attr_names = ('name', ) class NamedInitializer(Node): __slots__ = ('name', 'expr', 'coord', '__weakref__') def __init__(self, name, expr, coord=None): self.name = name self.expr = expr self.coord = coord def children(self): nodelist = [] if self.expr is not None: nodelist.append(("expr", self.expr)) for i, child in enumerate(self.name or []): nodelist.append(("name[%d]" % i, child)) return tuple(nodelist) def __iter__(self): if self.expr is not None: yield self.expr for child in (self.name or []): yield child attr_names = () class ParamList(Node): __slots__ = ('params', 'coord', '__weakref__') def __init__(self, params, coord=None): self.params = params self.coord = coord def children(self): nodelist = [] for i, child in enumerate(self.params or []): nodelist.append(("params[%d]" % i, child)) return tuple(nodelist) def __iter__(self): for child in (self.params or []): yield child attr_names = () class PtrDecl(Node): __slots__ = ('quals', 'type', 'coord', '__weakref__') def __init__(self, quals, type, coord=None): self.quals = quals self.type = type self.coord = coord def children(self): nodelist = [] if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) def __iter__(self): if self.type is not None: yield self.type attr_names = ('quals', ) class Return(Node): __slots__ = ('expr', 'coord', '__weakref__') def __init__(self, expr, coord=None): self.expr = expr self.coord = coord def children(self): nodelist = [] if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) def __iter__(self): if self.expr is not None: yield self.expr attr_names = () class StaticAssert(Node): __slots__ = ('cond', 'message', 'coord', '__weakref__') def __init__(self, cond, message, coord=None): self.cond = cond self.message = message self.coord = coord def children(self): nodelist = [] if self.cond is not None: nodelist.append(("cond", self.cond)) if self.message is not None: nodelist.append(("message", self.message)) return tuple(nodelist) def __iter__(self): if self.cond is not None: yield self.cond if self.message is not None: yield self.message attr_names = () class Struct(Node): __slots__ = ('name', 'decls', 'coord', '__weakref__') def __init__(self, name, decls, coord=None): self.name = name self.decls = decls self.coord = coord def children(self): nodelist = [] for i, child in enumerate(self.decls or []): nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) def __iter__(self): for child in (self.decls or []): yield child attr_names = ('name', ) class StructRef(Node): __slots__ = ('name', 'type', 'field', 'coord', '__weakref__') def __init__(self, name, type, field, coord=None): self.name = name self.type = type self.field = field self.coord = coord def children(self): nodelist = [] if self.name is not None: nodelist.append(("name", self.name)) if self.field is not None: nodelist.append(("field", self.field)) return tuple(nodelist) def __iter__(self): if self.name is not None: yield self.name if self.field is not None: yield self.field attr_names = ('type', ) class Switch(Node): __slots__ = ('cond', 'stmt', 'coord', '__weakref__') def __init__(self, cond, stmt, coord=None): self.cond = cond self.stmt = stmt self.coord = coord def children(self): nodelist = [] if self.cond is not None: nodelist.append(("cond", self.cond)) if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) def __iter__(self): if self.cond is not None: yield self.cond if self.stmt is not None: yield self.stmt attr_names = () class TernaryOp(Node): __slots__ = ('cond', 'iftrue', 'iffalse', 'coord', '__weakref__') def __init__(self, cond, iftrue, iffalse, coord=None): self.cond = cond self.iftrue = iftrue self.iffalse = iffalse self.coord = coord def children(self): nodelist = [] if self.cond is not None: nodelist.append(("cond", self.cond)) if self.iftrue is not None: nodelist.append(("iftrue", self.iftrue)) if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) return tuple(nodelist) def __iter__(self): if self.cond is not None: yield self.cond if self.iftrue is not None: yield self.iftrue if self.iffalse is not None: yield self.iffalse attr_names = () class TypeDecl(Node): __slots__ = ('declname', 'quals', 'align', 'type', 'coord', '__weakref__') def __init__(self, declname, quals, align, type, coord=None): self.declname = declname self.quals = quals self.align = align self.type = type self.coord = coord def children(self): nodelist = [] if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) def __iter__(self): if self.type is not None: yield self.type attr_names = ('declname', 'quals', 'align', ) class Typedef(Node): __slots__ = ('name', 'quals', 'storage', 'type', 'coord', '__weakref__') def __init__(self, name, quals, storage, type, coord=None): self.name = name self.quals = quals self.storage = storage self.type = type self.coord = coord def children(self): nodelist = [] if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) def __iter__(self): if self.type is not None: yield self.type attr_names = ('name', 'quals', 'storage', ) class Typename(Node): __slots__ = ('name', 'quals', 'align', 'type', 'coord', '__weakref__') def __init__(self, name, quals, align, type, coord=None): self.name = name self.quals = quals self.align = align self.type = type self.coord = coord def children(self): nodelist = [] if self.type is not None: nodelist.append(("type", self.type)) return tuple(nodelist) def __iter__(self): if self.type is not None: yield self.type attr_names = ('name', 'quals', 'align', ) class UnaryOp(Node): __slots__ = ('op', 'expr', 'coord', '__weakref__') def __init__(self, op, expr, coord=None): self.op = op self.expr = expr self.coord = coord def children(self): nodelist = [] if self.expr is not None: nodelist.append(("expr", self.expr)) return tuple(nodelist) def __iter__(self): if self.expr is not None: yield self.expr attr_names = ('op', ) class Union(Node): __slots__ = ('name', 'decls', 'coord', '__weakref__') def __init__(self, name, decls, coord=None): self.name = name self.decls = decls self.coord = coord def children(self): nodelist = [] for i, child in enumerate(self.decls or []): nodelist.append(("decls[%d]" % i, child)) return tuple(nodelist) def __iter__(self): for child in (self.decls or []): yield child attr_names = ('name', ) class While(Node): __slots__ = ('cond', 'stmt', 'coord', '__weakref__') def __init__(self, cond, stmt, coord=None): self.cond = cond self.stmt = stmt self.coord = coord def children(self): nodelist = [] if self.cond is not None: nodelist.append(("cond", self.cond)) if self.stmt is not None: nodelist.append(("stmt", self.stmt)) return tuple(nodelist) def __iter__(self): if self.cond is not None: yield self.cond if self.stmt is not None: yield self.stmt attr_names = () class Pragma(Node): __slots__ = ('string', 'coord', '__weakref__') def __init__(self, string, coord=None): self.string = string self.coord = coord def children(self): nodelist = [] return tuple(nodelist) def __iter__(self): return yield attr_names = ('string', ) c_generator.py000064400000042554147205113120007414 0ustar00#------------------------------------------------------------------------------ # pycparser: c_generator.py # # C code generator from pycparser AST nodes. # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ from . import c_ast class CGenerator(object): """ Uses the same visitor pattern as c_ast.NodeVisitor, but modified to return a value from each visit method, using string accumulation in generic_visit. """ def __init__(self, reduce_parentheses=False): """ Constructs C-code generator reduce_parentheses: if True, eliminates needless parentheses on binary operators """ # Statements start with indentation of self.indent_level spaces, using # the _make_indent method. self.indent_level = 0 self.reduce_parentheses = reduce_parentheses def _make_indent(self): return ' ' * self.indent_level def visit(self, node): method = 'visit_' + node.__class__.__name__ return getattr(self, method, self.generic_visit)(node) def generic_visit(self, node): if node is None: return '' else: return ''.join(self.visit(c) for c_name, c in node.children()) def visit_Constant(self, n): return n.value def visit_ID(self, n): return n.name def visit_Pragma(self, n): ret = '#pragma' if n.string: ret += ' ' + n.string return ret def visit_ArrayRef(self, n): arrref = self._parenthesize_unless_simple(n.name) return arrref + '[' + self.visit(n.subscript) + ']' def visit_StructRef(self, n): sref = self._parenthesize_unless_simple(n.name) return sref + n.type + self.visit(n.field) def visit_FuncCall(self, n): fref = self._parenthesize_unless_simple(n.name) return fref + '(' + self.visit(n.args) + ')' def visit_UnaryOp(self, n): if n.op == 'sizeof': # Always parenthesize the argument of sizeof since it can be # a name. return 'sizeof(%s)' % self.visit(n.expr) else: operand = self._parenthesize_unless_simple(n.expr) if n.op == 'p++': return '%s++' % operand elif n.op == 'p--': return '%s--' % operand else: return '%s%s' % (n.op, operand) # Precedence map of binary operators: precedence_map = { # Should be in sync with c_parser.CParser.precedence # Higher numbers are stronger binding '||': 0, # weakest binding '&&': 1, '|': 2, '^': 3, '&': 4, '==': 5, '!=': 5, '>': 6, '>=': 6, '<': 6, '<=': 6, '>>': 7, '<<': 7, '+': 8, '-': 8, '*': 9, '/': 9, '%': 9 # strongest binding } def visit_BinaryOp(self, n): # Note: all binary operators are left-to-right associative # # If `n.left.op` has a stronger or equally binding precedence in # comparison to `n.op`, no parenthesis are needed for the left: # e.g., `(a*b) + c` is equivalent to `a*b + c`, as well as # `(a+b) - c` is equivalent to `a+b - c` (same precedence). # If the left operator is weaker binding than the current, then # parentheses are necessary: # e.g., `(a+b) * c` is NOT equivalent to `a+b * c`. lval_str = self._parenthesize_if( n.left, lambda d: not (self._is_simple_node(d) or self.reduce_parentheses and isinstance(d, c_ast.BinaryOp) and self.precedence_map[d.op] >= self.precedence_map[n.op])) # If `n.right.op` has a stronger -but not equal- binding precedence, # parenthesis can be omitted on the right: # e.g., `a + (b*c)` is equivalent to `a + b*c`. # If the right operator is weaker or equally binding, then parentheses # are necessary: # e.g., `a * (b+c)` is NOT equivalent to `a * b+c` and # `a - (b+c)` is NOT equivalent to `a - b+c` (same precedence). rval_str = self._parenthesize_if( n.right, lambda d: not (self._is_simple_node(d) or self.reduce_parentheses and isinstance(d, c_ast.BinaryOp) and self.precedence_map[d.op] > self.precedence_map[n.op])) return '%s %s %s' % (lval_str, n.op, rval_str) def visit_Assignment(self, n): rval_str = self._parenthesize_if( n.rvalue, lambda n: isinstance(n, c_ast.Assignment)) return '%s %s %s' % (self.visit(n.lvalue), n.op, rval_str) def visit_IdentifierType(self, n): return ' '.join(n.names) def _visit_expr(self, n): if isinstance(n, c_ast.InitList): return '{' + self.visit(n) + '}' elif isinstance(n, c_ast.ExprList): return '(' + self.visit(n) + ')' else: return self.visit(n) def visit_Decl(self, n, no_type=False): # no_type is used when a Decl is part of a DeclList, where the type is # explicitly only for the first declaration in a list. # s = n.name if no_type else self._generate_decl(n) if n.bitsize: s += ' : ' + self.visit(n.bitsize) if n.init: s += ' = ' + self._visit_expr(n.init) return s def visit_DeclList(self, n): s = self.visit(n.decls[0]) if len(n.decls) > 1: s += ', ' + ', '.join(self.visit_Decl(decl, no_type=True) for decl in n.decls[1:]) return s def visit_Typedef(self, n): s = '' if n.storage: s += ' '.join(n.storage) + ' ' s += self._generate_type(n.type) return s def visit_Cast(self, n): s = '(' + self._generate_type(n.to_type, emit_declname=False) + ')' return s + ' ' + self._parenthesize_unless_simple(n.expr) def visit_ExprList(self, n): visited_subexprs = [] for expr in n.exprs: visited_subexprs.append(self._visit_expr(expr)) return ', '.join(visited_subexprs) def visit_InitList(self, n): visited_subexprs = [] for expr in n.exprs: visited_subexprs.append(self._visit_expr(expr)) return ', '.join(visited_subexprs) def visit_Enum(self, n): return self._generate_struct_union_enum(n, name='enum') def visit_Alignas(self, n): return '_Alignas({})'.format(self.visit(n.alignment)) def visit_Enumerator(self, n): if not n.value: return '{indent}{name},\n'.format( indent=self._make_indent(), name=n.name, ) else: return '{indent}{name} = {value},\n'.format( indent=self._make_indent(), name=n.name, value=self.visit(n.value), ) def visit_FuncDef(self, n): decl = self.visit(n.decl) self.indent_level = 0 body = self.visit(n.body) if n.param_decls: knrdecls = ';\n'.join(self.visit(p) for p in n.param_decls) return decl + '\n' + knrdecls + ';\n' + body + '\n' else: return decl + '\n' + body + '\n' def visit_FileAST(self, n): s = '' for ext in n.ext: if isinstance(ext, c_ast.FuncDef): s += self.visit(ext) elif isinstance(ext, c_ast.Pragma): s += self.visit(ext) + '\n' else: s += self.visit(ext) + ';\n' return s def visit_Compound(self, n): s = self._make_indent() + '{\n' self.indent_level += 2 if n.block_items: s += ''.join(self._generate_stmt(stmt) for stmt in n.block_items) self.indent_level -= 2 s += self._make_indent() + '}\n' return s def visit_CompoundLiteral(self, n): return '(' + self.visit(n.type) + '){' + self.visit(n.init) + '}' def visit_EmptyStatement(self, n): return ';' def visit_ParamList(self, n): return ', '.join(self.visit(param) for param in n.params) def visit_Return(self, n): s = 'return' if n.expr: s += ' ' + self.visit(n.expr) return s + ';' def visit_Break(self, n): return 'break;' def visit_Continue(self, n): return 'continue;' def visit_TernaryOp(self, n): s = '(' + self._visit_expr(n.cond) + ') ? ' s += '(' + self._visit_expr(n.iftrue) + ') : ' s += '(' + self._visit_expr(n.iffalse) + ')' return s def visit_If(self, n): s = 'if (' if n.cond: s += self.visit(n.cond) s += ')\n' s += self._generate_stmt(n.iftrue, add_indent=True) if n.iffalse: s += self._make_indent() + 'else\n' s += self._generate_stmt(n.iffalse, add_indent=True) return s def visit_For(self, n): s = 'for (' if n.init: s += self.visit(n.init) s += ';' if n.cond: s += ' ' + self.visit(n.cond) s += ';' if n.next: s += ' ' + self.visit(n.next) s += ')\n' s += self._generate_stmt(n.stmt, add_indent=True) return s def visit_While(self, n): s = 'while (' if n.cond: s += self.visit(n.cond) s += ')\n' s += self._generate_stmt(n.stmt, add_indent=True) return s def visit_DoWhile(self, n): s = 'do\n' s += self._generate_stmt(n.stmt, add_indent=True) s += self._make_indent() + 'while (' if n.cond: s += self.visit(n.cond) s += ');' return s def visit_StaticAssert(self, n): s = '_Static_assert(' s += self.visit(n.cond) if n.message: s += ',' s += self.visit(n.message) s += ')' return s def visit_Switch(self, n): s = 'switch (' + self.visit(n.cond) + ')\n' s += self._generate_stmt(n.stmt, add_indent=True) return s def visit_Case(self, n): s = 'case ' + self.visit(n.expr) + ':\n' for stmt in n.stmts: s += self._generate_stmt(stmt, add_indent=True) return s def visit_Default(self, n): s = 'default:\n' for stmt in n.stmts: s += self._generate_stmt(stmt, add_indent=True) return s def visit_Label(self, n): return n.name + ':\n' + self._generate_stmt(n.stmt) def visit_Goto(self, n): return 'goto ' + n.name + ';' def visit_EllipsisParam(self, n): return '...' def visit_Struct(self, n): return self._generate_struct_union_enum(n, 'struct') def visit_Typename(self, n): return self._generate_type(n.type) def visit_Union(self, n): return self._generate_struct_union_enum(n, 'union') def visit_NamedInitializer(self, n): s = '' for name in n.name: if isinstance(name, c_ast.ID): s += '.' + name.name else: s += '[' + self.visit(name) + ']' s += ' = ' + self._visit_expr(n.expr) return s def visit_FuncDecl(self, n): return self._generate_type(n) def visit_ArrayDecl(self, n): return self._generate_type(n, emit_declname=False) def visit_TypeDecl(self, n): return self._generate_type(n, emit_declname=False) def visit_PtrDecl(self, n): return self._generate_type(n, emit_declname=False) def _generate_struct_union_enum(self, n, name): """ Generates code for structs, unions, and enums. name should be 'struct', 'union', or 'enum'. """ if name in ('struct', 'union'): members = n.decls body_function = self._generate_struct_union_body else: assert name == 'enum' members = None if n.values is None else n.values.enumerators body_function = self._generate_enum_body s = name + ' ' + (n.name or '') if members is not None: # None means no members # Empty sequence means an empty list of members s += '\n' s += self._make_indent() self.indent_level += 2 s += '{\n' s += body_function(members) self.indent_level -= 2 s += self._make_indent() + '}' return s def _generate_struct_union_body(self, members): return ''.join(self._generate_stmt(decl) for decl in members) def _generate_enum_body(self, members): # `[:-2] + '\n'` removes the final `,` from the enumerator list return ''.join(self.visit(value) for value in members)[:-2] + '\n' def _generate_stmt(self, n, add_indent=False): """ Generation from a statement node. This method exists as a wrapper for individual visit_* methods to handle different treatment of some statements in this context. """ typ = type(n) if add_indent: self.indent_level += 2 indent = self._make_indent() if add_indent: self.indent_level -= 2 if typ in ( c_ast.Decl, c_ast.Assignment, c_ast.Cast, c_ast.UnaryOp, c_ast.BinaryOp, c_ast.TernaryOp, c_ast.FuncCall, c_ast.ArrayRef, c_ast.StructRef, c_ast.Constant, c_ast.ID, c_ast.Typedef, c_ast.ExprList): # These can also appear in an expression context so no semicolon # is added to them automatically # return indent + self.visit(n) + ';\n' elif typ in (c_ast.Compound,): # No extra indentation required before the opening brace of a # compound - because it consists of multiple lines it has to # compute its own indentation. # return self.visit(n) elif typ in (c_ast.If,): return indent + self.visit(n) else: return indent + self.visit(n) + '\n' def _generate_decl(self, n): """ Generation from a Decl node. """ s = '' if n.funcspec: s = ' '.join(n.funcspec) + ' ' if n.storage: s += ' '.join(n.storage) + ' ' if n.align: s += self.visit(n.align[0]) + ' ' s += self._generate_type(n.type) return s def _generate_type(self, n, modifiers=[], emit_declname = True): """ Recursive generation from a type node. n is the type node. modifiers collects the PtrDecl, ArrayDecl and FuncDecl modifiers encountered on the way down to a TypeDecl, to allow proper generation from it. """ typ = type(n) #~ print(n, modifiers) if typ == c_ast.TypeDecl: s = '' if n.quals: s += ' '.join(n.quals) + ' ' s += self.visit(n.type) nstr = n.declname if n.declname and emit_declname else '' # Resolve modifiers. # Wrap in parens to distinguish pointer to array and pointer to # function syntax. # for i, modifier in enumerate(modifiers): if isinstance(modifier, c_ast.ArrayDecl): if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): nstr = '(' + nstr + ')' nstr += '[' if modifier.dim_quals: nstr += ' '.join(modifier.dim_quals) + ' ' nstr += self.visit(modifier.dim) + ']' elif isinstance(modifier, c_ast.FuncDecl): if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): nstr = '(' + nstr + ')' nstr += '(' + self.visit(modifier.args) + ')' elif isinstance(modifier, c_ast.PtrDecl): if modifier.quals: nstr = '* %s%s' % (' '.join(modifier.quals), ' ' + nstr if nstr else '') else: nstr = '*' + nstr if nstr: s += ' ' + nstr return s elif typ == c_ast.Decl: return self._generate_decl(n.type) elif typ == c_ast.Typename: return self._generate_type(n.type, emit_declname = emit_declname) elif typ == c_ast.IdentifierType: return ' '.join(n.names) + ' ' elif typ in (c_ast.ArrayDecl, c_ast.PtrDecl, c_ast.FuncDecl): return self._generate_type(n.type, modifiers + [n], emit_declname = emit_declname) else: return self.visit(n) def _parenthesize_if(self, n, condition): """ Visits 'n' and returns its string representation, parenthesized if the condition function applied to the node returns True. """ s = self._visit_expr(n) if condition(n): return '(' + s + ')' else: return s def _parenthesize_unless_simple(self, n): """ Common use case for _parenthesize_if """ return self._parenthesize_if(n, lambda d: not self._is_simple_node(d)) def _is_simple_node(self, n): """ Returns True for nodes that are "simple" - i.e. nodes that always have higher precedence than operators. """ return isinstance(n, (c_ast.Constant, c_ast.ID, c_ast.ArrayRef, c_ast.StructRef, c_ast.FuncCall)) c_lexer.py000064400000041442147205113120006540 0ustar00#------------------------------------------------------------------------------ # pycparser: c_lexer.py # # CLexer class: lexer for the C language # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ import re from .ply import lex from .ply.lex import TOKEN class CLexer(object): """ A lexer for the C language. After building it, set the input text with input(), and call token() to get new tokens. The public attribute filename can be set to an initial filename, but the lexer will update it upon #line directives. """ def __init__(self, error_func, on_lbrace_func, on_rbrace_func, type_lookup_func): """ Create a new Lexer. error_func: An error function. Will be called with an error message, line and column as arguments, in case of an error during lexing. on_lbrace_func, on_rbrace_func: Called when an LBRACE or RBRACE is encountered (likely to push/pop type_lookup_func's scope) type_lookup_func: A type lookup function. Given a string, it must return True IFF this string is a name of a type that was defined with a typedef earlier. """ self.error_func = error_func self.on_lbrace_func = on_lbrace_func self.on_rbrace_func = on_rbrace_func self.type_lookup_func = type_lookup_func self.filename = '' # Keeps track of the last token returned from self.token() self.last_token = None # Allow either "# line" or "# " to support GCC's # cpp output # self.line_pattern = re.compile(r'([ \t]*line\W)|([ \t]*\d+)') self.pragma_pattern = re.compile(r'[ \t]*pragma\W') def build(self, **kwargs): """ Builds the lexer from the specification. Must be called after the lexer object is created. This method exists separately, because the PLY manual warns against calling lex.lex inside __init__ """ self.lexer = lex.lex(object=self, **kwargs) def reset_lineno(self): """ Resets the internal line number counter of the lexer. """ self.lexer.lineno = 1 def input(self, text): self.lexer.input(text) def token(self): self.last_token = self.lexer.token() return self.last_token def find_tok_column(self, token): """ Find the column of the token in its line. """ last_cr = self.lexer.lexdata.rfind('\n', 0, token.lexpos) return token.lexpos - last_cr ######################-- PRIVATE --###################### ## ## Internal auxiliary methods ## def _error(self, msg, token): location = self._make_tok_location(token) self.error_func(msg, location[0], location[1]) self.lexer.skip(1) def _make_tok_location(self, token): return (token.lineno, self.find_tok_column(token)) ## ## Reserved keywords ## keywords = ( 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN', 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', 'REGISTER', 'OFFSETOF', 'RESTRICT', 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', 'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID', 'VOLATILE', 'WHILE', '__INT128', ) keywords_new = ( '_BOOL', '_COMPLEX', '_NORETURN', '_THREAD_LOCAL', '_STATIC_ASSERT', '_ATOMIC', '_ALIGNOF', '_ALIGNAS', '_PRAGMA', ) keyword_map = {} for keyword in keywords: keyword_map[keyword.lower()] = keyword for keyword in keywords_new: keyword_map[keyword[:2].upper() + keyword[2:].lower()] = keyword ## ## All the tokens recognized by the lexer ## tokens = keywords + keywords_new + ( # Identifiers 'ID', # Type identifiers (identifiers previously defined as # types with typedef) 'TYPEID', # constants 'INT_CONST_DEC', 'INT_CONST_OCT', 'INT_CONST_HEX', 'INT_CONST_BIN', 'INT_CONST_CHAR', 'FLOAT_CONST', 'HEX_FLOAT_CONST', 'CHAR_CONST', 'WCHAR_CONST', 'U8CHAR_CONST', 'U16CHAR_CONST', 'U32CHAR_CONST', # String literals 'STRING_LITERAL', 'WSTRING_LITERAL', 'U8STRING_LITERAL', 'U16STRING_LITERAL', 'U32STRING_LITERAL', # Operators 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MOD', 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', 'LOR', 'LAND', 'LNOT', 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', # Assignment 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', 'PLUSEQUAL', 'MINUSEQUAL', 'LSHIFTEQUAL','RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', 'OREQUAL', # Increment/decrement 'PLUSPLUS', 'MINUSMINUS', # Structure dereference (->) 'ARROW', # Conditional operator (?) 'CONDOP', # Delimiters 'LPAREN', 'RPAREN', # ( ) 'LBRACKET', 'RBRACKET', # [ ] 'LBRACE', 'RBRACE', # { } 'COMMA', 'PERIOD', # . , 'SEMI', 'COLON', # ; : # Ellipsis (...) 'ELLIPSIS', # pre-processor 'PPHASH', # '#' 'PPPRAGMA', # 'pragma' 'PPPRAGMASTR', ) ## ## Regexes for use in tokens ## ## # valid C identifiers (K&R2: A.2.3), plus '$' (supported by some compilers) identifier = r'[a-zA-Z_$][0-9a-zA-Z_$]*' hex_prefix = '0[xX]' hex_digits = '[0-9a-fA-F]+' bin_prefix = '0[bB]' bin_digits = '[01]+' # integer constants (K&R2: A.2.5.1) integer_suffix_opt = r'(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?' decimal_constant = '(0'+integer_suffix_opt+')|([1-9][0-9]*'+integer_suffix_opt+')' octal_constant = '0[0-7]*'+integer_suffix_opt hex_constant = hex_prefix+hex_digits+integer_suffix_opt bin_constant = bin_prefix+bin_digits+integer_suffix_opt bad_octal_constant = '0[0-7]*[89]' # character constants (K&R2: A.2.5.2) # Note: a-zA-Z and '.-~^_!=&;,' are allowed as escape chars to support #line # directives with Windows paths as filenames (..\..\dir\file) # For the same reason, decimal_escape allows all digit sequences. We want to # parse all correct code, even if it means to sometimes parse incorrect # code. # # The original regexes were taken verbatim from the C syntax definition, # and were later modified to avoid worst-case exponential running time. # # simple_escape = r"""([a-zA-Z._~!=&\^\-\\?'"])""" # decimal_escape = r"""(\d+)""" # hex_escape = r"""(x[0-9a-fA-F]+)""" # bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])""" # # The following modifications were made to avoid the ambiguity that allowed backtracking: # (https://github.com/eliben/pycparser/issues/61) # # - \x was removed from simple_escape, unless it was not followed by a hex digit, to avoid ambiguity with hex_escape. # - hex_escape allows one or more hex characters, but requires that the next character(if any) is not hex # - decimal_escape allows one or more decimal characters, but requires that the next character(if any) is not a decimal # - bad_escape does not allow any decimals (8-9), to avoid conflicting with the permissive decimal_escape. # # Without this change, python's `re` module would recursively try parsing each ambiguous escape sequence in multiple ways. # e.g. `\123` could be parsed as `\1`+`23`, `\12`+`3`, and `\123`. simple_escape = r"""([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))""" decimal_escape = r"""(\d+)(?!\d)""" hex_escape = r"""(x[0-9a-fA-F]+)(?![0-9a-fA-F])""" bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-9])""" escape_sequence = r"""(\\("""+simple_escape+'|'+decimal_escape+'|'+hex_escape+'))' # This complicated regex with lookahead might be slow for strings, so because all of the valid escapes (including \x) allowed # 0 or more non-escaped characters after the first character, simple_escape+decimal_escape+hex_escape got simplified to escape_sequence_start_in_string = r"""(\\[0-9a-zA-Z._~!=&\^\-\\?'"])""" cconst_char = r"""([^'\\\n]|"""+escape_sequence+')' char_const = "'"+cconst_char+"'" wchar_const = 'L'+char_const u8char_const = 'u8'+char_const u16char_const = 'u'+char_const u32char_const = 'U'+char_const multicharacter_constant = "'"+cconst_char+"{2,4}'" unmatched_quote = "('"+cconst_char+"*\\n)|('"+cconst_char+"*$)" bad_char_const = r"""('"""+cconst_char+"""[^'\n]+')|('')|('"""+bad_escape+r"""[^'\n]*')""" # string literals (K&R2: A.2.6) string_char = r"""([^"\\\n]|"""+escape_sequence_start_in_string+')' string_literal = '"'+string_char+'*"' wstring_literal = 'L'+string_literal u8string_literal = 'u8'+string_literal u16string_literal = 'u'+string_literal u32string_literal = 'U'+string_literal bad_string_literal = '"'+string_char+'*'+bad_escape+string_char+'*"' # floating constants (K&R2: A.2.5.3) exponent_part = r"""([eE][-+]?[0-9]+)""" fractional_constant = r"""([0-9]*\.[0-9]+)|([0-9]+\.)""" floating_constant = '(((('+fractional_constant+')'+exponent_part+'?)|([0-9]+'+exponent_part+'))[FfLl]?)' binary_exponent_part = r'''([pP][+-]?[0-9]+)''' hex_fractional_constant = '((('+hex_digits+r""")?\."""+hex_digits+')|('+hex_digits+r"""\.))""" hex_floating_constant = '('+hex_prefix+'('+hex_digits+'|'+hex_fractional_constant+')'+binary_exponent_part+'[FfLl]?)' ## ## Lexer states: used for preprocessor \n-terminated directives ## states = ( # ppline: preprocessor line directives # ('ppline', 'exclusive'), # pppragma: pragma # ('pppragma', 'exclusive'), ) def t_PPHASH(self, t): r'[ \t]*\#' if self.line_pattern.match(t.lexer.lexdata, pos=t.lexer.lexpos): t.lexer.begin('ppline') self.pp_line = self.pp_filename = None elif self.pragma_pattern.match(t.lexer.lexdata, pos=t.lexer.lexpos): t.lexer.begin('pppragma') else: t.type = 'PPHASH' return t ## ## Rules for the ppline state ## @TOKEN(string_literal) def t_ppline_FILENAME(self, t): if self.pp_line is None: self._error('filename before line number in #line', t) else: self.pp_filename = t.value.lstrip('"').rstrip('"') @TOKEN(decimal_constant) def t_ppline_LINE_NUMBER(self, t): if self.pp_line is None: self.pp_line = t.value else: # Ignore: GCC's cpp sometimes inserts a numeric flag # after the file name pass def t_ppline_NEWLINE(self, t): r'\n' if self.pp_line is None: self._error('line number missing in #line', t) else: self.lexer.lineno = int(self.pp_line) if self.pp_filename is not None: self.filename = self.pp_filename t.lexer.begin('INITIAL') def t_ppline_PPLINE(self, t): r'line' pass t_ppline_ignore = ' \t' def t_ppline_error(self, t): self._error('invalid #line directive', t) ## ## Rules for the pppragma state ## def t_pppragma_NEWLINE(self, t): r'\n' t.lexer.lineno += 1 t.lexer.begin('INITIAL') def t_pppragma_PPPRAGMA(self, t): r'pragma' return t t_pppragma_ignore = ' \t' def t_pppragma_STR(self, t): '.+' t.type = 'PPPRAGMASTR' return t def t_pppragma_error(self, t): self._error('invalid #pragma directive', t) ## ## Rules for the normal state ## t_ignore = ' \t' # Newlines def t_NEWLINE(self, t): r'\n+' t.lexer.lineno += t.value.count("\n") # Operators t_PLUS = r'\+' t_MINUS = r'-' t_TIMES = r'\*' t_DIVIDE = r'/' t_MOD = r'%' t_OR = r'\|' t_AND = r'&' t_NOT = r'~' t_XOR = r'\^' t_LSHIFT = r'<<' t_RSHIFT = r'>>' t_LOR = r'\|\|' t_LAND = r'&&' t_LNOT = r'!' t_LT = r'<' t_GT = r'>' t_LE = r'<=' t_GE = r'>=' t_EQ = r'==' t_NE = r'!=' # Assignment operators t_EQUALS = r'=' t_TIMESEQUAL = r'\*=' t_DIVEQUAL = r'/=' t_MODEQUAL = r'%=' t_PLUSEQUAL = r'\+=' t_MINUSEQUAL = r'-=' t_LSHIFTEQUAL = r'<<=' t_RSHIFTEQUAL = r'>>=' t_ANDEQUAL = r'&=' t_OREQUAL = r'\|=' t_XOREQUAL = r'\^=' # Increment/decrement t_PLUSPLUS = r'\+\+' t_MINUSMINUS = r'--' # -> t_ARROW = r'->' # ? t_CONDOP = r'\?' # Delimiters t_LPAREN = r'\(' t_RPAREN = r'\)' t_LBRACKET = r'\[' t_RBRACKET = r'\]' t_COMMA = r',' t_PERIOD = r'\.' t_SEMI = r';' t_COLON = r':' t_ELLIPSIS = r'\.\.\.' # Scope delimiters # To see why on_lbrace_func is needed, consider: # typedef char TT; # void foo(int TT) { TT = 10; } # TT x = 5; # Outside the function, TT is a typedef, but inside (starting and ending # with the braces) it's a parameter. The trouble begins with yacc's # lookahead token. If we open a new scope in brace_open, then TT has # already been read and incorrectly interpreted as TYPEID. So, we need # to open and close scopes from within the lexer. # Similar for the TT immediately outside the end of the function. # @TOKEN(r'\{') def t_LBRACE(self, t): self.on_lbrace_func() return t @TOKEN(r'\}') def t_RBRACE(self, t): self.on_rbrace_func() return t t_STRING_LITERAL = string_literal # The following floating and integer constants are defined as # functions to impose a strict order (otherwise, decimal # is placed before the others because its regex is longer, # and this is bad) # @TOKEN(floating_constant) def t_FLOAT_CONST(self, t): return t @TOKEN(hex_floating_constant) def t_HEX_FLOAT_CONST(self, t): return t @TOKEN(hex_constant) def t_INT_CONST_HEX(self, t): return t @TOKEN(bin_constant) def t_INT_CONST_BIN(self, t): return t @TOKEN(bad_octal_constant) def t_BAD_CONST_OCT(self, t): msg = "Invalid octal constant" self._error(msg, t) @TOKEN(octal_constant) def t_INT_CONST_OCT(self, t): return t @TOKEN(decimal_constant) def t_INT_CONST_DEC(self, t): return t # Must come before bad_char_const, to prevent it from # catching valid char constants as invalid # @TOKEN(multicharacter_constant) def t_INT_CONST_CHAR(self, t): return t @TOKEN(char_const) def t_CHAR_CONST(self, t): return t @TOKEN(wchar_const) def t_WCHAR_CONST(self, t): return t @TOKEN(u8char_const) def t_U8CHAR_CONST(self, t): return t @TOKEN(u16char_const) def t_U16CHAR_CONST(self, t): return t @TOKEN(u32char_const) def t_U32CHAR_CONST(self, t): return t @TOKEN(unmatched_quote) def t_UNMATCHED_QUOTE(self, t): msg = "Unmatched '" self._error(msg, t) @TOKEN(bad_char_const) def t_BAD_CHAR_CONST(self, t): msg = "Invalid char constant %s" % t.value self._error(msg, t) @TOKEN(wstring_literal) def t_WSTRING_LITERAL(self, t): return t @TOKEN(u8string_literal) def t_U8STRING_LITERAL(self, t): return t @TOKEN(u16string_literal) def t_U16STRING_LITERAL(self, t): return t @TOKEN(u32string_literal) def t_U32STRING_LITERAL(self, t): return t # unmatched string literals are caught by the preprocessor @TOKEN(bad_string_literal) def t_BAD_STRING_LITERAL(self, t): msg = "String contains invalid escape code" self._error(msg, t) @TOKEN(identifier) def t_ID(self, t): t.type = self.keyword_map.get(t.value, "ID") if t.type == 'ID' and self.type_lookup_func(t.value): t.type = "TYPEID" return t def t_error(self, t): msg = 'Illegal character %s' % repr(t.value[0]) self._error(msg, t) c_parser.py000064400000221052147205113120006712 0ustar00#------------------------------------------------------------------------------ # pycparser: c_parser.py # # CParser class: Parser and AST builder for the C language # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #------------------------------------------------------------------------------ from .ply import yacc from . import c_ast from .c_lexer import CLexer from .plyparser import PLYParser, ParseError, parameterized, template from .ast_transforms import fix_switch_cases, fix_atomic_specifiers @template class CParser(PLYParser): def __init__( self, lex_optimize=True, lexer=CLexer, lextab='pycparser.lextab', yacc_optimize=True, yacctab='pycparser.yacctab', yacc_debug=False, taboutputdir=''): """ Create a new CParser. Some arguments for controlling the debug/optimization level of the parser are provided. The defaults are tuned for release/performance mode. The simple rules for using them are: *) When tweaking CParser/CLexer, set these to False *) When releasing a stable parser, set to True lex_optimize: Set to False when you're modifying the lexer. Otherwise, changes in the lexer won't be used, if some lextab.py file exists. When releasing with a stable lexer, set to True to save the re-generation of the lexer table on each run. lexer: Set this parameter to define the lexer to use if you're not using the default CLexer. lextab: Points to the lex table that's used for optimized mode. Only if you're modifying the lexer and want some tests to avoid re-generating the table, make this point to a local lex table file (that's been earlier generated with lex_optimize=True) yacc_optimize: Set to False when you're modifying the parser. Otherwise, changes in the parser won't be used, if some parsetab.py file exists. When releasing with a stable parser, set to True to save the re-generation of the parser table on each run. yacctab: Points to the yacc table that's used for optimized mode. Only if you're modifying the parser, make this point to a local yacc table file yacc_debug: Generate a parser.out file that explains how yacc built the parsing table from the grammar. taboutputdir: Set this parameter to control the location of generated lextab and yacctab files. """ self.clex = lexer( error_func=self._lex_error_func, on_lbrace_func=self._lex_on_lbrace_func, on_rbrace_func=self._lex_on_rbrace_func, type_lookup_func=self._lex_type_lookup_func) self.clex.build( optimize=lex_optimize, lextab=lextab, outputdir=taboutputdir) self.tokens = self.clex.tokens rules_with_opt = [ 'abstract_declarator', 'assignment_expression', 'declaration_list', 'declaration_specifiers_no_type', 'designation', 'expression', 'identifier_list', 'init_declarator_list', 'id_init_declarator_list', 'initializer_list', 'parameter_type_list', 'block_item_list', 'type_qualifier_list', 'struct_declarator_list' ] for rule in rules_with_opt: self._create_opt_rule(rule) self.cparser = yacc.yacc( module=self, start='translation_unit_or_empty', debug=yacc_debug, optimize=yacc_optimize, tabmodule=yacctab, outputdir=taboutputdir) # Stack of scopes for keeping track of symbols. _scope_stack[-1] is # the current (topmost) scope. Each scope is a dictionary that # specifies whether a name is a type. If _scope_stack[n][name] is # True, 'name' is currently a type in the scope. If it's False, # 'name' is used in the scope but not as a type (for instance, if we # saw: int name; # If 'name' is not a key in _scope_stack[n] then 'name' was not defined # in this scope at all. self._scope_stack = [dict()] # Keeps track of the last token given to yacc (the lookahead token) self._last_yielded_token = None def parse(self, text, filename='', debug=False): """ Parses C code and returns an AST. text: A string containing the C source code filename: Name of the file being parsed (for meaningful error messages) debug: Debug flag to YACC """ self.clex.filename = filename self.clex.reset_lineno() self._scope_stack = [dict()] self._last_yielded_token = None return self.cparser.parse( input=text, lexer=self.clex, debug=debug) ######################-- PRIVATE --###################### def _push_scope(self): self._scope_stack.append(dict()) def _pop_scope(self): assert len(self._scope_stack) > 1 self._scope_stack.pop() def _add_typedef_name(self, name, coord): """ Add a new typedef name (ie a TYPEID) to the current scope """ if not self._scope_stack[-1].get(name, True): self._parse_error( "Typedef %r previously declared as non-typedef " "in this scope" % name, coord) self._scope_stack[-1][name] = True def _add_identifier(self, name, coord): """ Add a new object, function, or enum member name (ie an ID) to the current scope """ if self._scope_stack[-1].get(name, False): self._parse_error( "Non-typedef %r previously declared as typedef " "in this scope" % name, coord) self._scope_stack[-1][name] = False def _is_type_in_scope(self, name): """ Is *name* a typedef-name in the current scope? """ for scope in reversed(self._scope_stack): # If name is an identifier in this scope it shadows typedefs in # higher scopes. in_scope = scope.get(name) if in_scope is not None: return in_scope return False def _lex_error_func(self, msg, line, column): self._parse_error(msg, self._coord(line, column)) def _lex_on_lbrace_func(self): self._push_scope() def _lex_on_rbrace_func(self): self._pop_scope() def _lex_type_lookup_func(self, name): """ Looks up types that were previously defined with typedef. Passed to the lexer for recognizing identifiers that are types. """ is_type = self._is_type_in_scope(name) return is_type def _get_yacc_lookahead_token(self): """ We need access to yacc's lookahead token in certain cases. This is the last token yacc requested from the lexer, so we ask the lexer. """ return self.clex.last_token # To understand what's going on here, read sections A.8.5 and # A.8.6 of K&R2 very carefully. # # A C type consists of a basic type declaration, with a list # of modifiers. For example: # # int *c[5]; # # The basic declaration here is 'int c', and the pointer and # the array are the modifiers. # # Basic declarations are represented by TypeDecl (from module c_ast) and the # modifiers are FuncDecl, PtrDecl and ArrayDecl. # # The standard states that whenever a new modifier is parsed, it should be # added to the end of the list of modifiers. For example: # # K&R2 A.8.6.2: Array Declarators # # In a declaration T D where D has the form # D1 [constant-expression-opt] # and the type of the identifier in the declaration T D1 is # "type-modifier T", the type of the # identifier of D is "type-modifier array of T" # # This is what this method does. The declarator it receives # can be a list of declarators ending with TypeDecl. It # tacks the modifier to the end of this list, just before # the TypeDecl. # # Additionally, the modifier may be a list itself. This is # useful for pointers, that can come as a chain from the rule # p_pointer. In this case, the whole modifier list is spliced # into the new location. def _type_modify_decl(self, decl, modifier): """ Tacks a type modifier on a declarator, and returns the modified declarator. Note: the declarator and modifier may be modified """ #~ print '****' #~ decl.show(offset=3) #~ modifier.show(offset=3) #~ print '****' modifier_head = modifier modifier_tail = modifier # The modifier may be a nested list. Reach its tail. while modifier_tail.type: modifier_tail = modifier_tail.type # If the decl is a basic type, just tack the modifier onto it. if isinstance(decl, c_ast.TypeDecl): modifier_tail.type = decl return modifier else: # Otherwise, the decl is a list of modifiers. Reach # its tail and splice the modifier onto the tail, # pointing to the underlying basic type. decl_tail = decl while not isinstance(decl_tail.type, c_ast.TypeDecl): decl_tail = decl_tail.type modifier_tail.type = decl_tail.type decl_tail.type = modifier_head return decl # Due to the order in which declarators are constructed, # they have to be fixed in order to look like a normal AST. # # When a declaration arrives from syntax construction, it has # these problems: # * The innermost TypeDecl has no type (because the basic # type is only known at the uppermost declaration level) # * The declaration has no variable name, since that is saved # in the innermost TypeDecl # * The typename of the declaration is a list of type # specifiers, and not a node. Here, basic identifier types # should be separated from more complex types like enums # and structs. # # This method fixes these problems. def _fix_decl_name_type(self, decl, typename): """ Fixes a declaration. Modifies decl. """ # Reach the underlying basic type # type = decl while not isinstance(type, c_ast.TypeDecl): type = type.type decl.name = type.declname type.quals = decl.quals[:] # The typename is a list of types. If any type in this # list isn't an IdentifierType, it must be the only # type in the list (it's illegal to declare "int enum ..") # If all the types are basic, they're collected in the # IdentifierType holder. for tn in typename: if not isinstance(tn, c_ast.IdentifierType): if len(typename) > 1: self._parse_error( "Invalid multiple types specified", tn.coord) else: type.type = tn return decl if not typename: # Functions default to returning int # if not isinstance(decl.type, c_ast.FuncDecl): self._parse_error( "Missing type in declaration", decl.coord) type.type = c_ast.IdentifierType( ['int'], coord=decl.coord) else: # At this point, we know that typename is a list of IdentifierType # nodes. Concatenate all the names into a single list. # type.type = c_ast.IdentifierType( [name for id in typename for name in id.names], coord=typename[0].coord) return decl def _add_declaration_specifier(self, declspec, newspec, kind, append=False): """ Declaration specifiers are represented by a dictionary with the entries: * qual: a list of type qualifiers * storage: a list of storage type qualifiers * type: a list of type specifiers * function: a list of function specifiers * alignment: a list of alignment specifiers This method is given a declaration specifier, and a new specifier of a given kind. If `append` is True, the new specifier is added to the end of the specifiers list, otherwise it's added at the beginning. Returns the declaration specifier, with the new specifier incorporated. """ spec = declspec or dict(qual=[], storage=[], type=[], function=[], alignment=[]) if append: spec[kind].append(newspec) else: spec[kind].insert(0, newspec) return spec def _build_declarations(self, spec, decls, typedef_namespace=False): """ Builds a list of declarations all sharing the given specifiers. If typedef_namespace is true, each declared name is added to the "typedef namespace", which also includes objects, functions, and enum constants. """ is_typedef = 'typedef' in spec['storage'] declarations = [] # Bit-fields are allowed to be unnamed. if decls[0].get('bitsize') is not None: pass # When redeclaring typedef names as identifiers in inner scopes, a # problem can occur where the identifier gets grouped into # spec['type'], leaving decl as None. This can only occur for the # first declarator. elif decls[0]['decl'] is None: if len(spec['type']) < 2 or len(spec['type'][-1].names) != 1 or \ not self._is_type_in_scope(spec['type'][-1].names[0]): coord = '?' for t in spec['type']: if hasattr(t, 'coord'): coord = t.coord break self._parse_error('Invalid declaration', coord) # Make this look as if it came from "direct_declarator:ID" decls[0]['decl'] = c_ast.TypeDecl( declname=spec['type'][-1].names[0], type=None, quals=None, align=spec['alignment'], coord=spec['type'][-1].coord) # Remove the "new" type's name from the end of spec['type'] del spec['type'][-1] # A similar problem can occur where the declaration ends up looking # like an abstract declarator. Give it a name if this is the case. elif not isinstance(decls[0]['decl'], ( c_ast.Enum, c_ast.Struct, c_ast.Union, c_ast.IdentifierType)): decls_0_tail = decls[0]['decl'] while not isinstance(decls_0_tail, c_ast.TypeDecl): decls_0_tail = decls_0_tail.type if decls_0_tail.declname is None: decls_0_tail.declname = spec['type'][-1].names[0] del spec['type'][-1] for decl in decls: assert decl['decl'] is not None if is_typedef: declaration = c_ast.Typedef( name=None, quals=spec['qual'], storage=spec['storage'], type=decl['decl'], coord=decl['decl'].coord) else: declaration = c_ast.Decl( name=None, quals=spec['qual'], align=spec['alignment'], storage=spec['storage'], funcspec=spec['function'], type=decl['decl'], init=decl.get('init'), bitsize=decl.get('bitsize'), coord=decl['decl'].coord) if isinstance(declaration.type, ( c_ast.Enum, c_ast.Struct, c_ast.Union, c_ast.IdentifierType)): fixed_decl = declaration else: fixed_decl = self._fix_decl_name_type(declaration, spec['type']) # Add the type name defined by typedef to a # symbol table (for usage in the lexer) if typedef_namespace: if is_typedef: self._add_typedef_name(fixed_decl.name, fixed_decl.coord) else: self._add_identifier(fixed_decl.name, fixed_decl.coord) fixed_decl = fix_atomic_specifiers(fixed_decl) declarations.append(fixed_decl) return declarations def _build_function_definition(self, spec, decl, param_decls, body): """ Builds a function definition. """ if 'typedef' in spec['storage']: self._parse_error("Invalid typedef", decl.coord) declaration = self._build_declarations( spec=spec, decls=[dict(decl=decl, init=None)], typedef_namespace=True)[0] return c_ast.FuncDef( decl=declaration, param_decls=param_decls, body=body, coord=decl.coord) def _select_struct_union_class(self, token): """ Given a token (either STRUCT or UNION), selects the appropriate AST class. """ if token == 'struct': return c_ast.Struct else: return c_ast.Union ## ## Precedence and associativity of operators ## # If this changes, c_generator.CGenerator.precedence_map needs to change as # well precedence = ( ('left', 'LOR'), ('left', 'LAND'), ('left', 'OR'), ('left', 'XOR'), ('left', 'AND'), ('left', 'EQ', 'NE'), ('left', 'GT', 'GE', 'LT', 'LE'), ('left', 'RSHIFT', 'LSHIFT'), ('left', 'PLUS', 'MINUS'), ('left', 'TIMES', 'DIVIDE', 'MOD') ) ## ## Grammar productions ## Implementation of the BNF defined in K&R2 A.13 ## # Wrapper around a translation unit, to allow for empty input. # Not strictly part of the C99 Grammar, but useful in practice. def p_translation_unit_or_empty(self, p): """ translation_unit_or_empty : translation_unit | empty """ if p[1] is None: p[0] = c_ast.FileAST([]) else: p[0] = c_ast.FileAST(p[1]) def p_translation_unit_1(self, p): """ translation_unit : external_declaration """ # Note: external_declaration is already a list p[0] = p[1] def p_translation_unit_2(self, p): """ translation_unit : translation_unit external_declaration """ p[1].extend(p[2]) p[0] = p[1] # Declarations always come as lists (because they can be # several in one line), so we wrap the function definition # into a list as well, to make the return value of # external_declaration homogeneous. def p_external_declaration_1(self, p): """ external_declaration : function_definition """ p[0] = [p[1]] def p_external_declaration_2(self, p): """ external_declaration : declaration """ p[0] = p[1] def p_external_declaration_3(self, p): """ external_declaration : pp_directive | pppragma_directive """ p[0] = [p[1]] def p_external_declaration_4(self, p): """ external_declaration : SEMI """ p[0] = [] def p_external_declaration_5(self, p): """ external_declaration : static_assert """ p[0] = p[1] def p_static_assert_declaration(self, p): """ static_assert : _STATIC_ASSERT LPAREN constant_expression COMMA unified_string_literal RPAREN | _STATIC_ASSERT LPAREN constant_expression RPAREN """ if len(p) == 5: p[0] = [c_ast.StaticAssert(p[3], None, self._token_coord(p, 1))] else: p[0] = [c_ast.StaticAssert(p[3], p[5], self._token_coord(p, 1))] def p_pp_directive(self, p): """ pp_directive : PPHASH """ self._parse_error('Directives not supported yet', self._token_coord(p, 1)) # This encompasses two types of C99-compatible pragmas: # - The #pragma directive: # # pragma character_sequence # - The _Pragma unary operator: # _Pragma ( " string_literal " ) def p_pppragma_directive(self, p): """ pppragma_directive : PPPRAGMA | PPPRAGMA PPPRAGMASTR | _PRAGMA LPAREN unified_string_literal RPAREN """ if len(p) == 5: p[0] = c_ast.Pragma(p[3], self._token_coord(p, 2)) elif len(p) == 3: p[0] = c_ast.Pragma(p[2], self._token_coord(p, 2)) else: p[0] = c_ast.Pragma("", self._token_coord(p, 1)) def p_pppragma_directive_list(self, p): """ pppragma_directive_list : pppragma_directive | pppragma_directive_list pppragma_directive """ p[0] = [p[1]] if len(p) == 2 else p[1] + [p[2]] # In function definitions, the declarator can be followed by # a declaration list, for old "K&R style" function definitios. def p_function_definition_1(self, p): """ function_definition : id_declarator declaration_list_opt compound_statement """ # no declaration specifiers - 'int' becomes the default type spec = dict( qual=[], alignment=[], storage=[], type=[c_ast.IdentifierType(['int'], coord=self._token_coord(p, 1))], function=[]) p[0] = self._build_function_definition( spec=spec, decl=p[1], param_decls=p[2], body=p[3]) def p_function_definition_2(self, p): """ function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement """ spec = p[1] p[0] = self._build_function_definition( spec=spec, decl=p[2], param_decls=p[3], body=p[4]) # Note, according to C18 A.2.2 6.7.10 static_assert-declaration _Static_assert # is a declaration, not a statement. We additionally recognise it as a statement # to fix parsing of _Static_assert inside the functions. # def p_statement(self, p): """ statement : labeled_statement | expression_statement | compound_statement | selection_statement | iteration_statement | jump_statement | pppragma_directive | static_assert """ p[0] = p[1] # A pragma is generally considered a decorator rather than an actual # statement. Still, for the purposes of analyzing an abstract syntax tree of # C code, pragma's should not be ignored and were previously treated as a # statement. This presents a problem for constructs that take a statement # such as labeled_statements, selection_statements, and # iteration_statements, causing a misleading structure in the AST. For # example, consider the following C code. # # for (int i = 0; i < 3; i++) # #pragma omp critical # sum += 1; # # This code will compile and execute "sum += 1;" as the body of the for # loop. Previous implementations of PyCParser would render the AST for this # block of code as follows: # # For: # DeclList: # Decl: i, [], [], [] # TypeDecl: i, [] # IdentifierType: ['int'] # Constant: int, 0 # BinaryOp: < # ID: i # Constant: int, 3 # UnaryOp: p++ # ID: i # Pragma: omp critical # Assignment: += # ID: sum # Constant: int, 1 # # This AST misleadingly takes the Pragma as the body of the loop and the # assignment then becomes a sibling of the loop. # # To solve edge cases like these, the pragmacomp_or_statement rule groups # a pragma and its following statement (which would otherwise be orphaned) # using a compound block, effectively turning the above code into: # # for (int i = 0; i < 3; i++) { # #pragma omp critical # sum += 1; # } def p_pragmacomp_or_statement(self, p): """ pragmacomp_or_statement : pppragma_directive_list statement | statement """ if len(p) == 3: p[0] = c_ast.Compound( block_items=p[1]+[p[2]], coord=self._token_coord(p, 1)) else: p[0] = p[1] # In C, declarations can come several in a line: # int x, *px, romulo = 5; # # However, for the AST, we will split them to separate Decl # nodes. # # This rule splits its declarations and always returns a list # of Decl nodes, even if it's one element long. # def p_decl_body(self, p): """ decl_body : declaration_specifiers init_declarator_list_opt | declaration_specifiers_no_type id_init_declarator_list_opt """ spec = p[1] # p[2] (init_declarator_list_opt) is either a list or None # if p[2] is None: # By the standard, you must have at least one declarator unless # declaring a structure tag, a union tag, or the members of an # enumeration. # ty = spec['type'] s_u_or_e = (c_ast.Struct, c_ast.Union, c_ast.Enum) if len(ty) == 1 and isinstance(ty[0], s_u_or_e): decls = [c_ast.Decl( name=None, quals=spec['qual'], align=spec['alignment'], storage=spec['storage'], funcspec=spec['function'], type=ty[0], init=None, bitsize=None, coord=ty[0].coord)] # However, this case can also occur on redeclared identifiers in # an inner scope. The trouble is that the redeclared type's name # gets grouped into declaration_specifiers; _build_declarations # compensates for this. # else: decls = self._build_declarations( spec=spec, decls=[dict(decl=None, init=None)], typedef_namespace=True) else: decls = self._build_declarations( spec=spec, decls=p[2], typedef_namespace=True) p[0] = decls # The declaration has been split to a decl_body sub-rule and # SEMI, because having them in a single rule created a problem # for defining typedefs. # # If a typedef line was directly followed by a line using the # type defined with the typedef, the type would not be # recognized. This is because to reduce the declaration rule, # the parser's lookahead asked for the token after SEMI, which # was the type from the next line, and the lexer had no chance # to see the updated type symbol table. # # Splitting solves this problem, because after seeing SEMI, # the parser reduces decl_body, which actually adds the new # type into the table to be seen by the lexer before the next # line is reached. def p_declaration(self, p): """ declaration : decl_body SEMI """ p[0] = p[1] # Since each declaration is a list of declarations, this # rule will combine all the declarations and return a single # list # def p_declaration_list(self, p): """ declaration_list : declaration | declaration_list declaration """ p[0] = p[1] if len(p) == 2 else p[1] + p[2] # To know when declaration-specifiers end and declarators begin, # we require declaration-specifiers to have at least one # type-specifier, and disallow typedef-names after we've seen any # type-specifier. These are both required by the spec. # def p_declaration_specifiers_no_type_1(self, p): """ declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'qual') def p_declaration_specifiers_no_type_2(self, p): """ declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'storage') def p_declaration_specifiers_no_type_3(self, p): """ declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'function') # Without this, `typedef _Atomic(T) U` will parse incorrectly because the # _Atomic qualifier will match, instead of the specifier. def p_declaration_specifiers_no_type_4(self, p): """ declaration_specifiers_no_type : atomic_specifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'type') def p_declaration_specifiers_no_type_5(self, p): """ declaration_specifiers_no_type : alignment_specifier declaration_specifiers_no_type_opt """ p[0] = self._add_declaration_specifier(p[2], p[1], 'alignment') def p_declaration_specifiers_1(self, p): """ declaration_specifiers : declaration_specifiers type_qualifier """ p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) def p_declaration_specifiers_2(self, p): """ declaration_specifiers : declaration_specifiers storage_class_specifier """ p[0] = self._add_declaration_specifier(p[1], p[2], 'storage', append=True) def p_declaration_specifiers_3(self, p): """ declaration_specifiers : declaration_specifiers function_specifier """ p[0] = self._add_declaration_specifier(p[1], p[2], 'function', append=True) def p_declaration_specifiers_4(self, p): """ declaration_specifiers : declaration_specifiers type_specifier_no_typeid """ p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) def p_declaration_specifiers_5(self, p): """ declaration_specifiers : type_specifier """ p[0] = self._add_declaration_specifier(None, p[1], 'type') def p_declaration_specifiers_6(self, p): """ declaration_specifiers : declaration_specifiers_no_type type_specifier """ p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) def p_declaration_specifiers_7(self, p): """ declaration_specifiers : declaration_specifiers alignment_specifier """ p[0] = self._add_declaration_specifier(p[1], p[2], 'alignment', append=True) def p_storage_class_specifier(self, p): """ storage_class_specifier : AUTO | REGISTER | STATIC | EXTERN | TYPEDEF | _THREAD_LOCAL """ p[0] = p[1] def p_function_specifier(self, p): """ function_specifier : INLINE | _NORETURN """ p[0] = p[1] def p_type_specifier_no_typeid(self, p): """ type_specifier_no_typeid : VOID | _BOOL | CHAR | SHORT | INT | LONG | FLOAT | DOUBLE | _COMPLEX | SIGNED | UNSIGNED | __INT128 """ p[0] = c_ast.IdentifierType([p[1]], coord=self._token_coord(p, 1)) def p_type_specifier(self, p): """ type_specifier : typedef_name | enum_specifier | struct_or_union_specifier | type_specifier_no_typeid | atomic_specifier """ p[0] = p[1] # See section 6.7.2.4 of the C11 standard. def p_atomic_specifier(self, p): """ atomic_specifier : _ATOMIC LPAREN type_name RPAREN """ typ = p[3] typ.quals.append('_Atomic') p[0] = typ def p_type_qualifier(self, p): """ type_qualifier : CONST | RESTRICT | VOLATILE | _ATOMIC """ p[0] = p[1] def p_init_declarator_list(self, p): """ init_declarator_list : init_declarator | init_declarator_list COMMA init_declarator """ p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] # Returns a {decl= : init=} dictionary # If there's no initializer, uses None # def p_init_declarator(self, p): """ init_declarator : declarator | declarator EQUALS initializer """ p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) def p_id_init_declarator_list(self, p): """ id_init_declarator_list : id_init_declarator | id_init_declarator_list COMMA init_declarator """ p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] def p_id_init_declarator(self, p): """ id_init_declarator : id_declarator | id_declarator EQUALS initializer """ p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) # Require at least one type specifier in a specifier-qualifier-list # def p_specifier_qualifier_list_1(self, p): """ specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid """ p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) def p_specifier_qualifier_list_2(self, p): """ specifier_qualifier_list : specifier_qualifier_list type_qualifier """ p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) def p_specifier_qualifier_list_3(self, p): """ specifier_qualifier_list : type_specifier """ p[0] = self._add_declaration_specifier(None, p[1], 'type') def p_specifier_qualifier_list_4(self, p): """ specifier_qualifier_list : type_qualifier_list type_specifier """ p[0] = dict(qual=p[1], alignment=[], storage=[], type=[p[2]], function=[]) def p_specifier_qualifier_list_5(self, p): """ specifier_qualifier_list : alignment_specifier """ p[0] = dict(qual=[], alignment=[p[1]], storage=[], type=[], function=[]) def p_specifier_qualifier_list_6(self, p): """ specifier_qualifier_list : specifier_qualifier_list alignment_specifier """ p[0] = self._add_declaration_specifier(p[1], p[2], 'alignment') # TYPEID is allowed here (and in other struct/enum related tag names), because # struct/enum tags reside in their own namespace and can be named the same as types # def p_struct_or_union_specifier_1(self, p): """ struct_or_union_specifier : struct_or_union ID | struct_or_union TYPEID """ klass = self._select_struct_union_class(p[1]) # None means no list of members p[0] = klass( name=p[2], decls=None, coord=self._token_coord(p, 2)) def p_struct_or_union_specifier_2(self, p): """ struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close | struct_or_union brace_open brace_close """ klass = self._select_struct_union_class(p[1]) if len(p) == 4: # Empty sequence means an empty list of members p[0] = klass( name=None, decls=[], coord=self._token_coord(p, 2)) else: p[0] = klass( name=None, decls=p[3], coord=self._token_coord(p, 2)) def p_struct_or_union_specifier_3(self, p): """ struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close | struct_or_union ID brace_open brace_close | struct_or_union TYPEID brace_open struct_declaration_list brace_close | struct_or_union TYPEID brace_open brace_close """ klass = self._select_struct_union_class(p[1]) if len(p) == 5: # Empty sequence means an empty list of members p[0] = klass( name=p[2], decls=[], coord=self._token_coord(p, 2)) else: p[0] = klass( name=p[2], decls=p[4], coord=self._token_coord(p, 2)) def p_struct_or_union(self, p): """ struct_or_union : STRUCT | UNION """ p[0] = p[1] # Combine all declarations into a single list # def p_struct_declaration_list(self, p): """ struct_declaration_list : struct_declaration | struct_declaration_list struct_declaration """ if len(p) == 2: p[0] = p[1] or [] else: p[0] = p[1] + (p[2] or []) def p_struct_declaration_1(self, p): """ struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI """ spec = p[1] assert 'typedef' not in spec['storage'] if p[2] is not None: decls = self._build_declarations( spec=spec, decls=p[2]) elif len(spec['type']) == 1: # Anonymous struct/union, gcc extension, C1x feature. # Although the standard only allows structs/unions here, I see no # reason to disallow other types since some compilers have typedefs # here, and pycparser isn't about rejecting all invalid code. # node = spec['type'][0] if isinstance(node, c_ast.Node): decl_type = node else: decl_type = c_ast.IdentifierType(node) decls = self._build_declarations( spec=spec, decls=[dict(decl=decl_type)]) else: # Structure/union members can have the same names as typedefs. # The trouble is that the member's name gets grouped into # specifier_qualifier_list; _build_declarations compensates. # decls = self._build_declarations( spec=spec, decls=[dict(decl=None, init=None)]) p[0] = decls def p_struct_declaration_2(self, p): """ struct_declaration : SEMI """ p[0] = None def p_struct_declaration_3(self, p): """ struct_declaration : pppragma_directive """ p[0] = [p[1]] def p_struct_declarator_list(self, p): """ struct_declarator_list : struct_declarator | struct_declarator_list COMMA struct_declarator """ p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] # struct_declarator passes up a dict with the keys: decl (for # the underlying declarator) and bitsize (for the bitsize) # def p_struct_declarator_1(self, p): """ struct_declarator : declarator """ p[0] = {'decl': p[1], 'bitsize': None} def p_struct_declarator_2(self, p): """ struct_declarator : declarator COLON constant_expression | COLON constant_expression """ if len(p) > 3: p[0] = {'decl': p[1], 'bitsize': p[3]} else: p[0] = {'decl': c_ast.TypeDecl(None, None, None, None), 'bitsize': p[2]} def p_enum_specifier_1(self, p): """ enum_specifier : ENUM ID | ENUM TYPEID """ p[0] = c_ast.Enum(p[2], None, self._token_coord(p, 1)) def p_enum_specifier_2(self, p): """ enum_specifier : ENUM brace_open enumerator_list brace_close """ p[0] = c_ast.Enum(None, p[3], self._token_coord(p, 1)) def p_enum_specifier_3(self, p): """ enum_specifier : ENUM ID brace_open enumerator_list brace_close | ENUM TYPEID brace_open enumerator_list brace_close """ p[0] = c_ast.Enum(p[2], p[4], self._token_coord(p, 1)) def p_enumerator_list(self, p): """ enumerator_list : enumerator | enumerator_list COMMA | enumerator_list COMMA enumerator """ if len(p) == 2: p[0] = c_ast.EnumeratorList([p[1]], p[1].coord) elif len(p) == 3: p[0] = p[1] else: p[1].enumerators.append(p[3]) p[0] = p[1] def p_alignment_specifier(self, p): """ alignment_specifier : _ALIGNAS LPAREN type_name RPAREN | _ALIGNAS LPAREN constant_expression RPAREN """ p[0] = c_ast.Alignas(p[3], self._token_coord(p, 1)) def p_enumerator(self, p): """ enumerator : ID | ID EQUALS constant_expression """ if len(p) == 2: enumerator = c_ast.Enumerator( p[1], None, self._token_coord(p, 1)) else: enumerator = c_ast.Enumerator( p[1], p[3], self._token_coord(p, 1)) self._add_identifier(enumerator.name, enumerator.coord) p[0] = enumerator def p_declarator(self, p): """ declarator : id_declarator | typeid_declarator """ p[0] = p[1] @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) def p_xxx_declarator_1(self, p): """ xxx_declarator : direct_xxx_declarator """ p[0] = p[1] @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) def p_xxx_declarator_2(self, p): """ xxx_declarator : pointer direct_xxx_declarator """ p[0] = self._type_modify_decl(p[2], p[1]) @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) def p_direct_xxx_declarator_1(self, p): """ direct_xxx_declarator : yyy """ p[0] = c_ast.TypeDecl( declname=p[1], type=None, quals=None, align=None, coord=self._token_coord(p, 1)) @parameterized(('id', 'ID'), ('typeid', 'TYPEID')) def p_direct_xxx_declarator_2(self, p): """ direct_xxx_declarator : LPAREN xxx_declarator RPAREN """ p[0] = p[2] @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) def p_direct_xxx_declarator_3(self, p): """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET """ quals = (p[3] if len(p) > 5 else []) or [] # Accept dimension qualifiers # Per C99 6.7.5.3 p7 arr = c_ast.ArrayDecl( type=None, dim=p[4] if len(p) > 5 else p[3], dim_quals=quals, coord=p[1].coord) p[0] = self._type_modify_decl(decl=p[1], modifier=arr) @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) def p_direct_xxx_declarator_4(self, p): """ direct_xxx_declarator : direct_xxx_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET | direct_xxx_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET """ # Using slice notation for PLY objects doesn't work in Python 3 for the # version of PLY embedded with pycparser; see PLY Google Code issue 30. # Work around that here by listing the two elements separately. listed_quals = [item if isinstance(item, list) else [item] for item in [p[3],p[4]]] dim_quals = [qual for sublist in listed_quals for qual in sublist if qual is not None] arr = c_ast.ArrayDecl( type=None, dim=p[5], dim_quals=dim_quals, coord=p[1].coord) p[0] = self._type_modify_decl(decl=p[1], modifier=arr) # Special for VLAs # @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) def p_direct_xxx_declarator_5(self, p): """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET """ arr = c_ast.ArrayDecl( type=None, dim=c_ast.ID(p[4], self._token_coord(p, 4)), dim_quals=p[3] if p[3] is not None else [], coord=p[1].coord) p[0] = self._type_modify_decl(decl=p[1], modifier=arr) @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) def p_direct_xxx_declarator_6(self, p): """ direct_xxx_declarator : direct_xxx_declarator LPAREN parameter_type_list RPAREN | direct_xxx_declarator LPAREN identifier_list_opt RPAREN """ func = c_ast.FuncDecl( args=p[3], type=None, coord=p[1].coord) # To see why _get_yacc_lookahead_token is needed, consider: # typedef char TT; # void foo(int TT) { TT = 10; } # Outside the function, TT is a typedef, but inside (starting and # ending with the braces) it's a parameter. The trouble begins with # yacc's lookahead token. We don't know if we're declaring or # defining a function until we see LBRACE, but if we wait for yacc to # trigger a rule on that token, then TT will have already been read # and incorrectly interpreted as TYPEID. We need to add the # parameters to the scope the moment the lexer sees LBRACE. # if self._get_yacc_lookahead_token().type == "LBRACE": if func.args is not None: for param in func.args.params: if isinstance(param, c_ast.EllipsisParam): break self._add_identifier(param.name, param.coord) p[0] = self._type_modify_decl(decl=p[1], modifier=func) def p_pointer(self, p): """ pointer : TIMES type_qualifier_list_opt | TIMES type_qualifier_list_opt pointer """ coord = self._token_coord(p, 1) # Pointer decls nest from inside out. This is important when different # levels have different qualifiers. For example: # # char * const * p; # # Means "pointer to const pointer to char" # # While: # # char ** const p; # # Means "const pointer to pointer to char" # # So when we construct PtrDecl nestings, the leftmost pointer goes in # as the most nested type. nested_type = c_ast.PtrDecl(quals=p[2] or [], type=None, coord=coord) if len(p) > 3: tail_type = p[3] while tail_type.type is not None: tail_type = tail_type.type tail_type.type = nested_type p[0] = p[3] else: p[0] = nested_type def p_type_qualifier_list(self, p): """ type_qualifier_list : type_qualifier | type_qualifier_list type_qualifier """ p[0] = [p[1]] if len(p) == 2 else p[1] + [p[2]] def p_parameter_type_list(self, p): """ parameter_type_list : parameter_list | parameter_list COMMA ELLIPSIS """ if len(p) > 2: p[1].params.append(c_ast.EllipsisParam(self._token_coord(p, 3))) p[0] = p[1] def p_parameter_list(self, p): """ parameter_list : parameter_declaration | parameter_list COMMA parameter_declaration """ if len(p) == 2: # single parameter p[0] = c_ast.ParamList([p[1]], p[1].coord) else: p[1].params.append(p[3]) p[0] = p[1] # From ISO/IEC 9899:TC2, 6.7.5.3.11: # "If, in a parameter declaration, an identifier can be treated either # as a typedef name or as a parameter name, it shall be taken as a # typedef name." # # Inside a parameter declaration, once we've reduced declaration specifiers, # if we shift in an LPAREN and see a TYPEID, it could be either an abstract # declarator or a declarator nested inside parens. This rule tells us to # always treat it as an abstract declarator. Therefore, we only accept # `id_declarator`s and `typeid_noparen_declarator`s. def p_parameter_declaration_1(self, p): """ parameter_declaration : declaration_specifiers id_declarator | declaration_specifiers typeid_noparen_declarator """ spec = p[1] if not spec['type']: spec['type'] = [c_ast.IdentifierType(['int'], coord=self._token_coord(p, 1))] p[0] = self._build_declarations( spec=spec, decls=[dict(decl=p[2])])[0] def p_parameter_declaration_2(self, p): """ parameter_declaration : declaration_specifiers abstract_declarator_opt """ spec = p[1] if not spec['type']: spec['type'] = [c_ast.IdentifierType(['int'], coord=self._token_coord(p, 1))] # Parameters can have the same names as typedefs. The trouble is that # the parameter's name gets grouped into declaration_specifiers, making # it look like an old-style declaration; compensate. # if len(spec['type']) > 1 and len(spec['type'][-1].names) == 1 and \ self._is_type_in_scope(spec['type'][-1].names[0]): decl = self._build_declarations( spec=spec, decls=[dict(decl=p[2], init=None)])[0] # This truly is an old-style parameter declaration # else: decl = c_ast.Typename( name='', quals=spec['qual'], align=None, type=p[2] or c_ast.TypeDecl(None, None, None, None), coord=self._token_coord(p, 2)) typename = spec['type'] decl = self._fix_decl_name_type(decl, typename) p[0] = decl def p_identifier_list(self, p): """ identifier_list : identifier | identifier_list COMMA identifier """ if len(p) == 2: # single parameter p[0] = c_ast.ParamList([p[1]], p[1].coord) else: p[1].params.append(p[3]) p[0] = p[1] def p_initializer_1(self, p): """ initializer : assignment_expression """ p[0] = p[1] def p_initializer_2(self, p): """ initializer : brace_open initializer_list_opt brace_close | brace_open initializer_list COMMA brace_close """ if p[2] is None: p[0] = c_ast.InitList([], self._token_coord(p, 1)) else: p[0] = p[2] def p_initializer_list(self, p): """ initializer_list : designation_opt initializer | initializer_list COMMA designation_opt initializer """ if len(p) == 3: # single initializer init = p[2] if p[1] is None else c_ast.NamedInitializer(p[1], p[2]) p[0] = c_ast.InitList([init], p[2].coord) else: init = p[4] if p[3] is None else c_ast.NamedInitializer(p[3], p[4]) p[1].exprs.append(init) p[0] = p[1] def p_designation(self, p): """ designation : designator_list EQUALS """ p[0] = p[1] # Designators are represented as a list of nodes, in the order in which # they're written in the code. # def p_designator_list(self, p): """ designator_list : designator | designator_list designator """ p[0] = [p[1]] if len(p) == 2 else p[1] + [p[2]] def p_designator(self, p): """ designator : LBRACKET constant_expression RBRACKET | PERIOD identifier """ p[0] = p[2] def p_type_name(self, p): """ type_name : specifier_qualifier_list abstract_declarator_opt """ typename = c_ast.Typename( name='', quals=p[1]['qual'][:], align=None, type=p[2] or c_ast.TypeDecl(None, None, None, None), coord=self._token_coord(p, 2)) p[0] = self._fix_decl_name_type(typename, p[1]['type']) def p_abstract_declarator_1(self, p): """ abstract_declarator : pointer """ dummytype = c_ast.TypeDecl(None, None, None, None) p[0] = self._type_modify_decl( decl=dummytype, modifier=p[1]) def p_abstract_declarator_2(self, p): """ abstract_declarator : pointer direct_abstract_declarator """ p[0] = self._type_modify_decl(p[2], p[1]) def p_abstract_declarator_3(self, p): """ abstract_declarator : direct_abstract_declarator """ p[0] = p[1] # Creating and using direct_abstract_declarator_opt here # instead of listing both direct_abstract_declarator and the # lack of it in the beginning of _1 and _2 caused two # shift/reduce errors. # def p_direct_abstract_declarator_1(self, p): """ direct_abstract_declarator : LPAREN abstract_declarator RPAREN """ p[0] = p[2] def p_direct_abstract_declarator_2(self, p): """ direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET """ arr = c_ast.ArrayDecl( type=None, dim=p[3], dim_quals=[], coord=p[1].coord) p[0] = self._type_modify_decl(decl=p[1], modifier=arr) def p_direct_abstract_declarator_3(self, p): """ direct_abstract_declarator : LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET """ quals = (p[2] if len(p) > 4 else []) or [] p[0] = c_ast.ArrayDecl( type=c_ast.TypeDecl(None, None, None, None), dim=p[3] if len(p) > 4 else p[2], dim_quals=quals, coord=self._token_coord(p, 1)) def p_direct_abstract_declarator_4(self, p): """ direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET """ arr = c_ast.ArrayDecl( type=None, dim=c_ast.ID(p[3], self._token_coord(p, 3)), dim_quals=[], coord=p[1].coord) p[0] = self._type_modify_decl(decl=p[1], modifier=arr) def p_direct_abstract_declarator_5(self, p): """ direct_abstract_declarator : LBRACKET TIMES RBRACKET """ p[0] = c_ast.ArrayDecl( type=c_ast.TypeDecl(None, None, None, None), dim=c_ast.ID(p[3], self._token_coord(p, 3)), dim_quals=[], coord=self._token_coord(p, 1)) def p_direct_abstract_declarator_6(self, p): """ direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN """ func = c_ast.FuncDecl( args=p[3], type=None, coord=p[1].coord) p[0] = self._type_modify_decl(decl=p[1], modifier=func) def p_direct_abstract_declarator_7(self, p): """ direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN """ p[0] = c_ast.FuncDecl( args=p[2], type=c_ast.TypeDecl(None, None, None, None), coord=self._token_coord(p, 1)) # declaration is a list, statement isn't. To make it consistent, block_item # will always be a list # def p_block_item(self, p): """ block_item : declaration | statement """ p[0] = p[1] if isinstance(p[1], list) else [p[1]] # Since we made block_item a list, this just combines lists # def p_block_item_list(self, p): """ block_item_list : block_item | block_item_list block_item """ # Empty block items (plain ';') produce [None], so ignore them p[0] = p[1] if (len(p) == 2 or p[2] == [None]) else p[1] + p[2] def p_compound_statement_1(self, p): """ compound_statement : brace_open block_item_list_opt brace_close """ p[0] = c_ast.Compound( block_items=p[2], coord=self._token_coord(p, 1)) def p_labeled_statement_1(self, p): """ labeled_statement : ID COLON pragmacomp_or_statement """ p[0] = c_ast.Label(p[1], p[3], self._token_coord(p, 1)) def p_labeled_statement_2(self, p): """ labeled_statement : CASE constant_expression COLON pragmacomp_or_statement """ p[0] = c_ast.Case(p[2], [p[4]], self._token_coord(p, 1)) def p_labeled_statement_3(self, p): """ labeled_statement : DEFAULT COLON pragmacomp_or_statement """ p[0] = c_ast.Default([p[3]], self._token_coord(p, 1)) def p_selection_statement_1(self, p): """ selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement """ p[0] = c_ast.If(p[3], p[5], None, self._token_coord(p, 1)) def p_selection_statement_2(self, p): """ selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement """ p[0] = c_ast.If(p[3], p[5], p[7], self._token_coord(p, 1)) def p_selection_statement_3(self, p): """ selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement """ p[0] = fix_switch_cases( c_ast.Switch(p[3], p[5], self._token_coord(p, 1))) def p_iteration_statement_1(self, p): """ iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement """ p[0] = c_ast.While(p[3], p[5], self._token_coord(p, 1)) def p_iteration_statement_2(self, p): """ iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI """ p[0] = c_ast.DoWhile(p[5], p[2], self._token_coord(p, 1)) def p_iteration_statement_3(self, p): """ iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement """ p[0] = c_ast.For(p[3], p[5], p[7], p[9], self._token_coord(p, 1)) def p_iteration_statement_4(self, p): """ iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement """ p[0] = c_ast.For(c_ast.DeclList(p[3], self._token_coord(p, 1)), p[4], p[6], p[8], self._token_coord(p, 1)) def p_jump_statement_1(self, p): """ jump_statement : GOTO ID SEMI """ p[0] = c_ast.Goto(p[2], self._token_coord(p, 1)) def p_jump_statement_2(self, p): """ jump_statement : BREAK SEMI """ p[0] = c_ast.Break(self._token_coord(p, 1)) def p_jump_statement_3(self, p): """ jump_statement : CONTINUE SEMI """ p[0] = c_ast.Continue(self._token_coord(p, 1)) def p_jump_statement_4(self, p): """ jump_statement : RETURN expression SEMI | RETURN SEMI """ p[0] = c_ast.Return(p[2] if len(p) == 4 else None, self._token_coord(p, 1)) def p_expression_statement(self, p): """ expression_statement : expression_opt SEMI """ if p[1] is None: p[0] = c_ast.EmptyStatement(self._token_coord(p, 2)) else: p[0] = p[1] def p_expression(self, p): """ expression : assignment_expression | expression COMMA assignment_expression """ if len(p) == 2: p[0] = p[1] else: if not isinstance(p[1], c_ast.ExprList): p[1] = c_ast.ExprList([p[1]], p[1].coord) p[1].exprs.append(p[3]) p[0] = p[1] def p_parenthesized_compound_expression(self, p): """ assignment_expression : LPAREN compound_statement RPAREN """ p[0] = p[2] def p_typedef_name(self, p): """ typedef_name : TYPEID """ p[0] = c_ast.IdentifierType([p[1]], coord=self._token_coord(p, 1)) def p_assignment_expression(self, p): """ assignment_expression : conditional_expression | unary_expression assignment_operator assignment_expression """ if len(p) == 2: p[0] = p[1] else: p[0] = c_ast.Assignment(p[2], p[1], p[3], p[1].coord) # K&R2 defines these as many separate rules, to encode # precedence and associativity. Why work hard ? I'll just use # the built in precedence/associativity specification feature # of PLY. (see precedence declaration above) # def p_assignment_operator(self, p): """ assignment_operator : EQUALS | XOREQUAL | TIMESEQUAL | DIVEQUAL | MODEQUAL | PLUSEQUAL | MINUSEQUAL | LSHIFTEQUAL | RSHIFTEQUAL | ANDEQUAL | OREQUAL """ p[0] = p[1] def p_constant_expression(self, p): """ constant_expression : conditional_expression """ p[0] = p[1] def p_conditional_expression(self, p): """ conditional_expression : binary_expression | binary_expression CONDOP expression COLON conditional_expression """ if len(p) == 2: p[0] = p[1] else: p[0] = c_ast.TernaryOp(p[1], p[3], p[5], p[1].coord) def p_binary_expression(self, p): """ binary_expression : cast_expression | binary_expression TIMES binary_expression | binary_expression DIVIDE binary_expression | binary_expression MOD binary_expression | binary_expression PLUS binary_expression | binary_expression MINUS binary_expression | binary_expression RSHIFT binary_expression | binary_expression LSHIFT binary_expression | binary_expression LT binary_expression | binary_expression LE binary_expression | binary_expression GE binary_expression | binary_expression GT binary_expression | binary_expression EQ binary_expression | binary_expression NE binary_expression | binary_expression AND binary_expression | binary_expression OR binary_expression | binary_expression XOR binary_expression | binary_expression LAND binary_expression | binary_expression LOR binary_expression """ if len(p) == 2: p[0] = p[1] else: p[0] = c_ast.BinaryOp(p[2], p[1], p[3], p[1].coord) def p_cast_expression_1(self, p): """ cast_expression : unary_expression """ p[0] = p[1] def p_cast_expression_2(self, p): """ cast_expression : LPAREN type_name RPAREN cast_expression """ p[0] = c_ast.Cast(p[2], p[4], self._token_coord(p, 1)) def p_unary_expression_1(self, p): """ unary_expression : postfix_expression """ p[0] = p[1] def p_unary_expression_2(self, p): """ unary_expression : PLUSPLUS unary_expression | MINUSMINUS unary_expression | unary_operator cast_expression """ p[0] = c_ast.UnaryOp(p[1], p[2], p[2].coord) def p_unary_expression_3(self, p): """ unary_expression : SIZEOF unary_expression | SIZEOF LPAREN type_name RPAREN | _ALIGNOF LPAREN type_name RPAREN """ p[0] = c_ast.UnaryOp( p[1], p[2] if len(p) == 3 else p[3], self._token_coord(p, 1)) def p_unary_operator(self, p): """ unary_operator : AND | TIMES | PLUS | MINUS | NOT | LNOT """ p[0] = p[1] def p_postfix_expression_1(self, p): """ postfix_expression : primary_expression """ p[0] = p[1] def p_postfix_expression_2(self, p): """ postfix_expression : postfix_expression LBRACKET expression RBRACKET """ p[0] = c_ast.ArrayRef(p[1], p[3], p[1].coord) def p_postfix_expression_3(self, p): """ postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN | postfix_expression LPAREN RPAREN """ p[0] = c_ast.FuncCall(p[1], p[3] if len(p) == 5 else None, p[1].coord) def p_postfix_expression_4(self, p): """ postfix_expression : postfix_expression PERIOD ID | postfix_expression PERIOD TYPEID | postfix_expression ARROW ID | postfix_expression ARROW TYPEID """ field = c_ast.ID(p[3], self._token_coord(p, 3)) p[0] = c_ast.StructRef(p[1], p[2], field, p[1].coord) def p_postfix_expression_5(self, p): """ postfix_expression : postfix_expression PLUSPLUS | postfix_expression MINUSMINUS """ p[0] = c_ast.UnaryOp('p' + p[2], p[1], p[1].coord) def p_postfix_expression_6(self, p): """ postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close """ p[0] = c_ast.CompoundLiteral(p[2], p[5]) def p_primary_expression_1(self, p): """ primary_expression : identifier """ p[0] = p[1] def p_primary_expression_2(self, p): """ primary_expression : constant """ p[0] = p[1] def p_primary_expression_3(self, p): """ primary_expression : unified_string_literal | unified_wstring_literal """ p[0] = p[1] def p_primary_expression_4(self, p): """ primary_expression : LPAREN expression RPAREN """ p[0] = p[2] def p_primary_expression_5(self, p): """ primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN """ coord = self._token_coord(p, 1) p[0] = c_ast.FuncCall(c_ast.ID(p[1], coord), c_ast.ExprList([p[3], p[5]], coord), coord) def p_offsetof_member_designator(self, p): """ offsetof_member_designator : identifier | offsetof_member_designator PERIOD identifier | offsetof_member_designator LBRACKET expression RBRACKET """ if len(p) == 2: p[0] = p[1] elif len(p) == 4: p[0] = c_ast.StructRef(p[1], p[2], p[3], p[1].coord) elif len(p) == 5: p[0] = c_ast.ArrayRef(p[1], p[3], p[1].coord) else: raise NotImplementedError("Unexpected parsing state. len(p): %u" % len(p)) def p_argument_expression_list(self, p): """ argument_expression_list : assignment_expression | argument_expression_list COMMA assignment_expression """ if len(p) == 2: # single expr p[0] = c_ast.ExprList([p[1]], p[1].coord) else: p[1].exprs.append(p[3]) p[0] = p[1] def p_identifier(self, p): """ identifier : ID """ p[0] = c_ast.ID(p[1], self._token_coord(p, 1)) def p_constant_1(self, p): """ constant : INT_CONST_DEC | INT_CONST_OCT | INT_CONST_HEX | INT_CONST_BIN | INT_CONST_CHAR """ uCount = 0 lCount = 0 for x in p[1][-3:]: if x in ('l', 'L'): lCount += 1 elif x in ('u', 'U'): uCount += 1 t = '' if uCount > 1: raise ValueError('Constant cannot have more than one u/U suffix.') elif lCount > 2: raise ValueError('Constant cannot have more than two l/L suffix.') prefix = 'unsigned ' * uCount + 'long ' * lCount p[0] = c_ast.Constant( prefix + 'int', p[1], self._token_coord(p, 1)) def p_constant_2(self, p): """ constant : FLOAT_CONST | HEX_FLOAT_CONST """ if 'x' in p[1].lower(): t = 'float' else: if p[1][-1] in ('f', 'F'): t = 'float' elif p[1][-1] in ('l', 'L'): t = 'long double' else: t = 'double' p[0] = c_ast.Constant( t, p[1], self._token_coord(p, 1)) def p_constant_3(self, p): """ constant : CHAR_CONST | WCHAR_CONST | U8CHAR_CONST | U16CHAR_CONST | U32CHAR_CONST """ p[0] = c_ast.Constant( 'char', p[1], self._token_coord(p, 1)) # The "unified" string and wstring literal rules are for supporting # concatenation of adjacent string literals. # I.e. "hello " "world" is seen by the C compiler as a single string literal # with the value "hello world" # def p_unified_string_literal(self, p): """ unified_string_literal : STRING_LITERAL | unified_string_literal STRING_LITERAL """ if len(p) == 2: # single literal p[0] = c_ast.Constant( 'string', p[1], self._token_coord(p, 1)) else: p[1].value = p[1].value[:-1] + p[2][1:] p[0] = p[1] def p_unified_wstring_literal(self, p): """ unified_wstring_literal : WSTRING_LITERAL | U8STRING_LITERAL | U16STRING_LITERAL | U32STRING_LITERAL | unified_wstring_literal WSTRING_LITERAL | unified_wstring_literal U8STRING_LITERAL | unified_wstring_literal U16STRING_LITERAL | unified_wstring_literal U32STRING_LITERAL """ if len(p) == 2: # single literal p[0] = c_ast.Constant( 'string', p[1], self._token_coord(p, 1)) else: p[1].value = p[1].value.rstrip()[:-1] + p[2][2:] p[0] = p[1] def p_brace_open(self, p): """ brace_open : LBRACE """ p[0] = p[1] p.set_lineno(0, p.lineno(1)) def p_brace_close(self, p): """ brace_close : RBRACE """ p[0] = p[1] p.set_lineno(0, p.lineno(1)) def p_empty(self, p): 'empty : ' p[0] = None def p_error(self, p): # If error recovery is added here in the future, make sure # _get_yacc_lookahead_token still works! # if p: self._parse_error( 'before: %s' % p.value, self._coord(lineno=p.lineno, column=self.clex.find_tok_column(p))) else: self._parse_error('At end of input', self.clex.filename) lextab.py000064400000020552147205113120006375 0ustar00# lextab.py. This file automatically created by PLY (version 3.10). Don't edit! _tabversion = '3.10' _lextokens = set(('AND', 'ANDEQUAL', 'ARROW', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CHAR_CONST', 'COLON', 'COMMA', 'CONDOP', 'CONST', 'CONTINUE', 'DEFAULT', 'DIVEQUAL', 'DIVIDE', 'DO', 'DOUBLE', 'ELLIPSIS', 'ELSE', 'ENUM', 'EQ', 'EQUALS', 'EXTERN', 'FLOAT', 'FLOAT_CONST', 'FOR', 'GE', 'GOTO', 'GT', 'HEX_FLOAT_CONST', 'ID', 'IF', 'INLINE', 'INT', 'INT_CONST_BIN', 'INT_CONST_CHAR', 'INT_CONST_DEC', 'INT_CONST_HEX', 'INT_CONST_OCT', 'LAND', 'LBRACE', 'LBRACKET', 'LE', 'LNOT', 'LONG', 'LOR', 'LPAREN', 'LSHIFT', 'LSHIFTEQUAL', 'LT', 'MINUS', 'MINUSEQUAL', 'MINUSMINUS', 'MOD', 'MODEQUAL', 'NE', 'NOT', 'OFFSETOF', 'OR', 'OREQUAL', 'PERIOD', 'PLUS', 'PLUSEQUAL', 'PLUSPLUS', 'PPHASH', 'PPPRAGMA', 'PPPRAGMASTR', 'RBRACE', 'RBRACKET', 'REGISTER', 'RESTRICT', 'RETURN', 'RPAREN', 'RSHIFT', 'RSHIFTEQUAL', 'SEMI', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRING_LITERAL', 'STRUCT', 'SWITCH', 'TIMES', 'TIMESEQUAL', 'TYPEDEF', 'TYPEID', 'U16CHAR_CONST', 'U16STRING_LITERAL', 'U32CHAR_CONST', 'U32STRING_LITERAL', 'U8CHAR_CONST', 'U8STRING_LITERAL', 'UNION', 'UNSIGNED', 'VOID', 'VOLATILE', 'WCHAR_CONST', 'WHILE', 'WSTRING_LITERAL', 'XOR', 'XOREQUAL', '_ALIGNAS', '_ALIGNOF', '_ATOMIC', '_BOOL', '_COMPLEX', '_NORETURN', '_PRAGMA', '_STATIC_ASSERT', '_THREAD_LOCAL', '__INT128')) _lexreflags = 64 _lexliterals = '' _lexstateinfo = {'INITIAL': 'inclusive', 'ppline': 'exclusive', 'pppragma': 'exclusive'} _lexstatere = {'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F])))){2,4}\')|(?P\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?Pu8\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?Pu\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?PU\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-wyzA-Z._~!=&\\^\\-\\\\?\'"]|x(?![0-9a-fA-F]))|(\\d+)(?!\\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-9])[^\'\\n]*\'))|(?PL"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?Pu8"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?Pu"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?PU"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-9])([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P\\.\\.\\.)|(?P\\|\\|)|(?P\\+\\+)|(?P<<=)|(?P\\|=)|(?P\\+=)|(?P>>=)|(?P\\*=)|(?P\\^=)|(?P&=)|(?P->)|(?P\\?)|(?P/=)|(?P==)|(?P>=)|(?P&&)|(?P\\[)|(?P<=)|(?P\\()|(?P<<)|(?P-=)|(?P--)|(?P%=)|(?P!=)|(?P\\|)|(?P\\.)|(?P\\+)|(?P\\])|(?P\\))|(?P>>)|(?P\\*)|(?P\\^)|(?P&)|(?P:)|(?P,)|(?P/)|(?P=)|(?P>)|(?P!)|(?P<)|(?P-)|(?P%)|(?P~)|(?P;)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX'), None, None, None, None, None, None, None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_INT_CONST_CHAR', 'INT_CONST_CHAR'), None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_U8CHAR_CONST', 'U8CHAR_CONST'), None, None, None, None, None, None, ('t_U16CHAR_CONST', 'U16CHAR_CONST'), None, None, None, None, None, None, ('t_U32CHAR_CONST', 'U32CHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST'), None, None, None, None, None, None, None, None, None, None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, ('t_U8STRING_LITERAL', 'U8STRING_LITERAL'), None, None, ('t_U16STRING_LITERAL', 'U16STRING_LITERAL'), None, None, ('t_U32STRING_LITERAL', 'U32STRING_LITERAL'), None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, (None, 'ELLIPSIS'), (None, 'LOR'), (None, 'PLUSPLUS'), (None, 'LSHIFTEQUAL'), (None, 'OREQUAL'), (None, 'PLUSEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'TIMESEQUAL'), (None, 'XOREQUAL'), (None, 'ANDEQUAL'), (None, 'ARROW'), (None, 'CONDOP'), (None, 'DIVEQUAL'), (None, 'EQ'), (None, 'GE'), (None, 'LAND'), (None, 'LBRACKET'), (None, 'LE'), (None, 'LPAREN'), (None, 'LSHIFT'), (None, 'MINUSEQUAL'), (None, 'MINUSMINUS'), (None, 'MODEQUAL'), (None, 'NE'), (None, 'OR'), (None, 'PERIOD'), (None, 'PLUS'), (None, 'RBRACKET'), (None, 'RPAREN'), (None, 'RSHIFT'), (None, 'TIMES'), (None, 'XOR'), (None, 'AND'), (None, 'COLON'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'EQUALS'), (None, 'GT'), (None, 'LNOT'), (None, 'LT'), (None, 'MINUS'), (None, 'MOD'), (None, 'NOT'), (None, 'SEMI')])], 'ppline': [('(?P"([^"\\\\\\n]|(\\\\[0-9a-zA-Z._~!=&\\^\\-\\\\?\'"]))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P.+)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR')])]} _lexstateignore = {'INITIAL': ' \t', 'ppline': ' \t', 'pppragma': ' \t'} _lexstateerrorf = {'INITIAL': 't_error', 'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error'} _lexstateeoff = {} plyparser.py000064400000011413147205113120007133 0ustar00#----------------------------------------------------------------- # plyparser.py # # PLYParser class and other utilities for simplifying programming # parsers with PLY # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- import warnings class Coord(object): """ Coordinates of a syntactic element. Consists of: - File name - Line number - (optional) column number, for the Lexer """ __slots__ = ('file', 'line', 'column', '__weakref__') def __init__(self, file, line, column=None): self.file = file self.line = line self.column = column def __str__(self): str = "%s:%s" % (self.file, self.line) if self.column: str += ":%s" % self.column return str class ParseError(Exception): pass class PLYParser(object): def _create_opt_rule(self, rulename): """ Given a rule name, creates an optional ply.yacc rule for it. The name of the optional rule is _opt """ optname = rulename + '_opt' def optrule(self, p): p[0] = p[1] optrule.__doc__ = '%s : empty\n| %s' % (optname, rulename) optrule.__name__ = 'p_%s' % optname setattr(self.__class__, optrule.__name__, optrule) def _coord(self, lineno, column=None): return Coord( file=self.clex.filename, line=lineno, column=column) def _token_coord(self, p, token_idx): """ Returns the coordinates for the YaccProduction object 'p' indexed with 'token_idx'. The coordinate includes the 'lineno' and 'column'. Both follow the lex semantic, starting from 1. """ last_cr = p.lexer.lexer.lexdata.rfind('\n', 0, p.lexpos(token_idx)) if last_cr < 0: last_cr = -1 column = (p.lexpos(token_idx) - (last_cr)) return self._coord(p.lineno(token_idx), column) def _parse_error(self, msg, coord): raise ParseError("%s: %s" % (coord, msg)) def parameterized(*params): """ Decorator to create parameterized rules. Parameterized rule methods must be named starting with 'p_' and contain 'xxx', and their docstrings may contain 'xxx' and 'yyy'. These will be replaced by the given parameter tuples. For example, ``p_xxx_rule()`` with docstring 'xxx_rule : yyy' when decorated with ``@parameterized(('id', 'ID'))`` produces ``p_id_rule()`` with the docstring 'id_rule : ID'. Using multiple tuples produces multiple rules. """ def decorate(rule_func): rule_func._params = params return rule_func return decorate def template(cls): """ Class decorator to generate rules from parameterized rule templates. See `parameterized` for more information on parameterized rules. """ issued_nodoc_warning = False for attr_name in dir(cls): if attr_name.startswith('p_'): method = getattr(cls, attr_name) if hasattr(method, '_params'): # Remove the template method delattr(cls, attr_name) # Create parameterized rules from this method; only run this if # the method has a docstring. This is to address an issue when # pycparser's users are installed in -OO mode which strips # docstrings away. # See: https://github.com/eliben/pycparser/pull/198/ and # https://github.com/eliben/pycparser/issues/197 # for discussion. if method.__doc__ is not None: _create_param_rules(cls, method) elif not issued_nodoc_warning: warnings.warn( 'parsing methods must have __doc__ for pycparser to work properly', RuntimeWarning, stacklevel=2) issued_nodoc_warning = True return cls def _create_param_rules(cls, func): """ Create ply.yacc rules based on a parameterized rule function Generates new methods (one per each pair of parameters) based on the template rule function `func`, and attaches them to `cls`. The rule function's parameters must be accessible via its `_params` attribute. """ for xxx, yyy in func._params: # Use the template method's body for each new method def param_rule(self, p): func(self, p) # Substitute in the params for the grammar rule and function name param_rule.__doc__ = func.__doc__.replace('xxx', xxx).replace('yyy', yyy) param_rule.__name__ = func.__name__.replace('xxx', xxx) # Attach the new method to the class setattr(cls, param_rule.__name__, param_rule) yacctab.py000064400000631512147205113120006530 0ustar00 # yacctab.py # This file is automatically generated. Do not edit. _tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMODAUTO BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM EXTERN FLOAT FOR GOTO IF INLINE INT LONG REGISTER OFFSETOF RESTRICT RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH TYPEDEF UNION UNSIGNED VOID VOLATILE WHILE __INT128 _BOOL _COMPLEX _NORETURN _THREAD_LOCAL _STATIC_ASSERT _ATOMIC _ALIGNOF _ALIGNAS _PRAGMA ID TYPEID INT_CONST_DEC INT_CONST_OCT INT_CONST_HEX INT_CONST_BIN INT_CONST_CHAR FLOAT_CONST HEX_FLOAT_CONST CHAR_CONST WCHAR_CONST U8CHAR_CONST U16CHAR_CONST U32CHAR_CONST STRING_LITERAL WSTRING_LITERAL U8STRING_LITERAL U16STRING_LITERAL U32STRING_LITERAL PLUS MINUS TIMES DIVIDE MOD OR AND NOT XOR LSHIFT RSHIFT LOR LAND LNOT LT LE GT GE EQ NE EQUALS TIMESEQUAL DIVEQUAL MODEQUAL PLUSEQUAL MINUSEQUAL LSHIFTEQUAL RSHIFTEQUAL ANDEQUAL XOREQUAL OREQUAL PLUSPLUS MINUSMINUS ARROW CONDOP LPAREN RPAREN LBRACKET RBRACKET LBRACE RBRACE COMMA PERIOD SEMI COLON ELLIPSIS PPHASH PPPRAGMA PPPRAGMASTRabstract_declarator_opt : empty\n| abstract_declaratorassignment_expression_opt : empty\n| assignment_expressionblock_item_list_opt : empty\n| block_item_listdeclaration_list_opt : empty\n| declaration_listdeclaration_specifiers_no_type_opt : empty\n| declaration_specifiers_no_typedesignation_opt : empty\n| designationexpression_opt : empty\n| expressionid_init_declarator_list_opt : empty\n| id_init_declarator_listidentifier_list_opt : empty\n| identifier_listinit_declarator_list_opt : empty\n| init_declarator_listinitializer_list_opt : empty\n| initializer_listparameter_type_list_opt : empty\n| parameter_type_liststruct_declarator_list_opt : empty\n| struct_declarator_listtype_qualifier_list_opt : empty\n| type_qualifier_list direct_id_declarator : ID\n direct_id_declarator : LPAREN id_declarator RPAREN\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_id_declarator : direct_id_declarator LPAREN parameter_type_list RPAREN\n | direct_id_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_declarator : TYPEID\n direct_typeid_declarator : LPAREN typeid_declarator RPAREN\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_noparen_declarator : TYPEID\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN\n id_declarator : direct_id_declarator\n id_declarator : pointer direct_id_declarator\n typeid_declarator : direct_typeid_declarator\n typeid_declarator : pointer direct_typeid_declarator\n typeid_noparen_declarator : direct_typeid_noparen_declarator\n typeid_noparen_declarator : pointer direct_typeid_noparen_declarator\n translation_unit_or_empty : translation_unit\n | empty\n translation_unit : external_declaration\n translation_unit : translation_unit external_declaration\n external_declaration : function_definition\n external_declaration : declaration\n external_declaration : pp_directive\n | pppragma_directive\n external_declaration : SEMI\n external_declaration : static_assert\n static_assert : _STATIC_ASSERT LPAREN constant_expression COMMA unified_string_literal RPAREN\n | _STATIC_ASSERT LPAREN constant_expression RPAREN\n pp_directive : PPHASH\n pppragma_directive : PPPRAGMA\n | PPPRAGMA PPPRAGMASTR\n | _PRAGMA LPAREN unified_string_literal RPAREN\n pppragma_directive_list : pppragma_directive\n | pppragma_directive_list pppragma_directive\n function_definition : id_declarator declaration_list_opt compound_statement\n function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement\n statement : labeled_statement\n | expression_statement\n | compound_statement\n | selection_statement\n | iteration_statement\n | jump_statement\n | pppragma_directive\n | static_assert\n pragmacomp_or_statement : pppragma_directive_list statement\n | statement\n decl_body : declaration_specifiers init_declarator_list_opt\n | declaration_specifiers_no_type id_init_declarator_list_opt\n declaration : decl_body SEMI\n declaration_list : declaration\n | declaration_list declaration\n declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : atomic_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : alignment_specifier declaration_specifiers_no_type_opt\n declaration_specifiers : declaration_specifiers type_qualifier\n declaration_specifiers : declaration_specifiers storage_class_specifier\n declaration_specifiers : declaration_specifiers function_specifier\n declaration_specifiers : declaration_specifiers type_specifier_no_typeid\n declaration_specifiers : type_specifier\n declaration_specifiers : declaration_specifiers_no_type type_specifier\n declaration_specifiers : declaration_specifiers alignment_specifier\n storage_class_specifier : AUTO\n | REGISTER\n | STATIC\n | EXTERN\n | TYPEDEF\n | _THREAD_LOCAL\n function_specifier : INLINE\n | _NORETURN\n type_specifier_no_typeid : VOID\n | _BOOL\n | CHAR\n | SHORT\n | INT\n | LONG\n | FLOAT\n | DOUBLE\n | _COMPLEX\n | SIGNED\n | UNSIGNED\n | __INT128\n type_specifier : typedef_name\n | enum_specifier\n | struct_or_union_specifier\n | type_specifier_no_typeid\n | atomic_specifier\n atomic_specifier : _ATOMIC LPAREN type_name RPAREN\n type_qualifier : CONST\n | RESTRICT\n | VOLATILE\n | _ATOMIC\n init_declarator_list : init_declarator\n | init_declarator_list COMMA init_declarator\n init_declarator : declarator\n | declarator EQUALS initializer\n id_init_declarator_list : id_init_declarator\n | id_init_declarator_list COMMA init_declarator\n id_init_declarator : id_declarator\n | id_declarator EQUALS initializer\n specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid\n specifier_qualifier_list : specifier_qualifier_list type_qualifier\n specifier_qualifier_list : type_specifier\n specifier_qualifier_list : type_qualifier_list type_specifier\n specifier_qualifier_list : alignment_specifier\n specifier_qualifier_list : specifier_qualifier_list alignment_specifier\n struct_or_union_specifier : struct_or_union ID\n | struct_or_union TYPEID\n struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close\n | struct_or_union brace_open brace_close\n struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close\n | struct_or_union ID brace_open brace_close\n | struct_or_union TYPEID brace_open struct_declaration_list brace_close\n | struct_or_union TYPEID brace_open brace_close\n struct_or_union : STRUCT\n | UNION\n struct_declaration_list : struct_declaration\n | struct_declaration_list struct_declaration\n struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI\n struct_declaration : SEMI\n struct_declaration : pppragma_directive\n struct_declarator_list : struct_declarator\n | struct_declarator_list COMMA struct_declarator\n struct_declarator : declarator\n struct_declarator : declarator COLON constant_expression\n | COLON constant_expression\n enum_specifier : ENUM ID\n | ENUM TYPEID\n enum_specifier : ENUM brace_open enumerator_list brace_close\n enum_specifier : ENUM ID brace_open enumerator_list brace_close\n | ENUM TYPEID brace_open enumerator_list brace_close\n enumerator_list : enumerator\n | enumerator_list COMMA\n | enumerator_list COMMA enumerator\n alignment_specifier : _ALIGNAS LPAREN type_name RPAREN\n | _ALIGNAS LPAREN constant_expression RPAREN\n enumerator : ID\n | ID EQUALS constant_expression\n declarator : id_declarator\n | typeid_declarator\n pointer : TIMES type_qualifier_list_opt\n | TIMES type_qualifier_list_opt pointer\n type_qualifier_list : type_qualifier\n | type_qualifier_list type_qualifier\n parameter_type_list : parameter_list\n | parameter_list COMMA ELLIPSIS\n parameter_list : parameter_declaration\n | parameter_list COMMA parameter_declaration\n parameter_declaration : declaration_specifiers id_declarator\n | declaration_specifiers typeid_noparen_declarator\n parameter_declaration : declaration_specifiers abstract_declarator_opt\n identifier_list : identifier\n | identifier_list COMMA identifier\n initializer : assignment_expression\n initializer : brace_open initializer_list_opt brace_close\n | brace_open initializer_list COMMA brace_close\n initializer_list : designation_opt initializer\n | initializer_list COMMA designation_opt initializer\n designation : designator_list EQUALS\n designator_list : designator\n | designator_list designator\n designator : LBRACKET constant_expression RBRACKET\n | PERIOD identifier\n type_name : specifier_qualifier_list abstract_declarator_opt\n abstract_declarator : pointer\n abstract_declarator : pointer direct_abstract_declarator\n abstract_declarator : direct_abstract_declarator\n direct_abstract_declarator : LPAREN abstract_declarator RPAREN direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET\n direct_abstract_declarator : LBRACKET TIMES RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN\n direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN\n block_item : declaration\n | statement\n block_item_list : block_item\n | block_item_list block_item\n compound_statement : brace_open block_item_list_opt brace_close labeled_statement : ID COLON pragmacomp_or_statement labeled_statement : CASE constant_expression COLON pragmacomp_or_statement labeled_statement : DEFAULT COLON pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement jump_statement : GOTO ID SEMI jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI\n | RETURN SEMI\n expression_statement : expression_opt SEMI expression : assignment_expression\n | expression COMMA assignment_expression\n assignment_expression : LPAREN compound_statement RPAREN typedef_name : TYPEID assignment_expression : conditional_expression\n | unary_expression assignment_operator assignment_expression\n assignment_operator : EQUALS\n | XOREQUAL\n | TIMESEQUAL\n | DIVEQUAL\n | MODEQUAL\n | PLUSEQUAL\n | MINUSEQUAL\n | LSHIFTEQUAL\n | RSHIFTEQUAL\n | ANDEQUAL\n | OREQUAL\n constant_expression : conditional_expression conditional_expression : binary_expression\n | binary_expression CONDOP expression COLON conditional_expression\n binary_expression : cast_expression\n | binary_expression TIMES binary_expression\n | binary_expression DIVIDE binary_expression\n | binary_expression MOD binary_expression\n | binary_expression PLUS binary_expression\n | binary_expression MINUS binary_expression\n | binary_expression RSHIFT binary_expression\n | binary_expression LSHIFT binary_expression\n | binary_expression LT binary_expression\n | binary_expression LE binary_expression\n | binary_expression GE binary_expression\n | binary_expression GT binary_expression\n | binary_expression EQ binary_expression\n | binary_expression NE binary_expression\n | binary_expression AND binary_expression\n | binary_expression OR binary_expression\n | binary_expression XOR binary_expression\n | binary_expression LAND binary_expression\n | binary_expression LOR binary_expression\n cast_expression : unary_expression cast_expression : LPAREN type_name RPAREN cast_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression\n | MINUSMINUS unary_expression\n | unary_operator cast_expression\n unary_expression : SIZEOF unary_expression\n | SIZEOF LPAREN type_name RPAREN\n | _ALIGNOF LPAREN type_name RPAREN\n unary_operator : AND\n | TIMES\n | PLUS\n | MINUS\n | NOT\n | LNOT\n postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN\n | postfix_expression LPAREN RPAREN\n postfix_expression : postfix_expression PERIOD ID\n | postfix_expression PERIOD TYPEID\n | postfix_expression ARROW ID\n | postfix_expression ARROW TYPEID\n postfix_expression : postfix_expression PLUSPLUS\n | postfix_expression MINUSMINUS\n postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close\n | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close\n primary_expression : identifier primary_expression : constant primary_expression : unified_string_literal\n | unified_wstring_literal\n primary_expression : LPAREN expression RPAREN primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN\n offsetof_member_designator : identifier\n | offsetof_member_designator PERIOD identifier\n | offsetof_member_designator LBRACKET expression RBRACKET\n argument_expression_list : assignment_expression\n | argument_expression_list COMMA assignment_expression\n identifier : ID constant : INT_CONST_DEC\n | INT_CONST_OCT\n | INT_CONST_HEX\n | INT_CONST_BIN\n | INT_CONST_CHAR\n constant : FLOAT_CONST\n | HEX_FLOAT_CONST\n constant : CHAR_CONST\n | WCHAR_CONST\n | U8CHAR_CONST\n | U16CHAR_CONST\n | U32CHAR_CONST\n unified_string_literal : STRING_LITERAL\n | unified_string_literal STRING_LITERAL\n unified_wstring_literal : WSTRING_LITERAL\n | U8STRING_LITERAL\n | U16STRING_LITERAL\n | U32STRING_LITERAL\n | unified_wstring_literal WSTRING_LITERAL\n | unified_wstring_literal U8STRING_LITERAL\n | unified_wstring_literal U16STRING_LITERAL\n | unified_wstring_literal U32STRING_LITERAL\n brace_open : LBRACE\n brace_close : RBRACE\n empty : ' _lr_action_items = {'$end':([0,1,2,3,4,5,6,7,8,9,10,14,15,64,90,91,127,208,251,262,267,355,499,],[-340,0,-58,-59,-60,-62,-63,-64,-65,-66,-67,-70,-71,-61,-90,-72,-76,-339,-77,-73,-69,-221,-68,]),'SEMI':([0,2,4,5,6,7,8,9,10,12,13,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,69,70,71,72,73,74,75,76,77,78,79,81,83,84,85,86,87,88,89,90,91,97,98,99,100,101,102,103,104,105,106,107,108,110,111,112,117,118,119,121,122,123,124,127,128,130,132,139,140,143,144,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,203,204,205,206,207,208,209,210,211,212,214,220,221,222,223,224,225,226,227,228,229,230,231,232,233,236,239,242,245,246,247,248,249,250,251,252,253,254,255,262,263,267,291,292,293,295,296,297,300,301,302,303,311,312,326,327,330,333,334,335,336,337,338,339,340,341,342,343,344,345,346,348,349,353,354,355,356,357,358,360,361,369,370,371,372,373,374,375,376,377,403,404,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,439,440,459,460,463,464,465,468,469,470,471,473,475,479,480,481,482,483,484,485,486,493,494,497,499,501,502,505,506,508,509,522,523,524,525,526,527,529,530,531,535,536,538,552,553,554,555,556,558,561,563,570,571,574,579,580,582,584,585,586,],[9,9,-60,-62,-63,-64,-65,-66,-67,-340,90,-70,-71,-52,-340,-340,-340,-128,-102,-340,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,-340,-340,-129,-134,-181,-98,-99,-100,-101,-104,-88,-134,-19,-20,-135,-137,-182,-54,-37,-90,-72,-53,-93,-9,-10,-340,-94,-95,-103,-89,-129,-15,-16,-139,-141,-97,-96,-169,-170,-338,-149,-150,210,-76,-340,-181,-55,-328,-30,-306,-255,-256,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,210,210,210,-152,-159,-339,-340,-162,-163,-145,-147,-13,-340,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-315,361,-14,-340,374,375,377,-238,-242,-277,-77,-38,-136,-138,-196,-73,-329,-69,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-35,-36,-140,-142,-171,210,-154,210,-156,-151,-160,465,-143,-144,-148,-25,-26,-164,-166,-146,-130,-177,-178,-221,-220,-13,-340,-340,-237,-340,-87,-74,-340,483,-233,-234,484,-236,-43,-44,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-274,-275,-276,-295,-296,-297,-298,-299,-31,-34,-172,-173,-153,-155,-161,-168,-222,-340,-224,-240,-239,-86,-75,529,-340,-232,-235,-243,-197,-39,-42,-278,-68,-293,-294,-284,-285,-32,-33,-165,-167,-223,-340,-340,-340,-340,559,-198,-40,-41,-257,-225,-87,-74,-227,-228,572,-302,-309,-340,580,-303,-226,-229,-340,-340,-231,-230,]),'PPHASH':([0,2,4,5,6,7,8,9,10,14,15,64,90,91,127,208,251,262,267,355,499,],[14,14,-60,-62,-63,-64,-65,-66,-67,-70,-71,-61,-90,-72,-76,-339,-77,-73,-69,-221,-68,]),'PPPRAGMA':([0,2,4,5,6,7,8,9,10,14,15,64,90,91,121,124,127,128,203,204,205,207,208,210,211,221,222,223,224,225,226,227,228,229,230,231,232,242,251,262,267,333,335,338,355,356,358,360,361,369,370,371,374,375,377,465,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[15,15,-60,-62,-63,-64,-65,-66,-67,-70,-71,-61,-90,-72,-338,15,-76,15,15,15,15,-159,-339,-162,-163,15,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,15,-77,-73,-69,15,15,-160,-221,-220,15,15,-237,15,-87,-74,-233,-234,-236,-161,-222,15,-224,-86,-75,-232,-235,-68,-223,15,15,15,-225,-87,-74,-227,-228,15,-226,-229,15,15,-231,-230,]),'_PRAGMA':([0,2,4,5,6,7,8,9,10,14,15,64,90,91,121,124,127,128,203,204,205,207,208,210,211,221,222,223,224,225,226,227,228,229,230,231,232,242,251,262,267,333,335,338,355,356,358,360,361,369,370,371,374,375,377,465,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[16,16,-60,-62,-63,-64,-65,-66,-67,-70,-71,-61,-90,-72,-338,16,-76,16,16,16,16,-159,-339,-162,-163,16,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,16,-77,-73,-69,16,16,-160,-221,-220,16,16,-237,16,-87,-74,-233,-234,-236,-161,-222,16,-224,-86,-75,-232,-235,-68,-223,16,16,16,-225,-87,-74,-227,-228,16,-226,-229,16,16,-231,-230,]),'_STATIC_ASSERT':([0,2,4,5,6,7,8,9,10,14,15,64,90,91,121,127,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,251,262,267,355,356,358,360,361,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[18,18,-60,-62,-63,-64,-65,-66,-67,-70,-71,-61,-90,-72,-338,-76,18,-339,18,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,18,-77,-73,-69,-221,-220,18,18,-237,18,-87,-74,-233,-234,-236,-222,18,-224,-86,-75,-232,-235,-68,-223,18,18,18,-225,-87,-74,-227,-228,18,-226,-229,18,18,-231,-230,]),'ID':([0,2,4,5,6,7,8,9,10,12,14,15,17,20,21,22,23,24,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,62,63,64,69,70,71,72,74,75,76,77,78,80,81,82,90,91,94,95,96,98,99,100,101,102,103,104,106,112,113,114,115,116,117,118,119,120,121,122,123,126,127,128,134,135,136,137,141,147,148,149,150,153,154,155,156,160,161,182,183,184,192,194,195,196,197,198,199,206,208,209,212,214,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,244,247,251,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,294,298,306,309,310,314,318,322,323,330,331,332,334,336,337,340,341,342,347,348,349,353,354,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,398,400,401,402,405,448,449,452,455,457,459,460,463,464,466,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,507,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,564,565,570,572,579,580,582,584,585,586,],[28,28,-60,-62,-63,-64,-65,-66,-67,28,-70,-71,28,28,-340,-340,-340,-128,-102,28,-340,-107,-340,-125,-126,-127,-129,-241,118,122,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-157,-158,-61,28,28,-129,-134,-98,-99,-100,-101,-104,28,-134,28,-90,-72,159,-340,159,-93,-9,-10,-340,-94,-95,-103,-129,-97,-183,-27,-28,-185,-96,-169,-170,202,-338,-149,-150,159,-76,233,28,159,-340,159,159,-287,-288,-289,-286,159,159,159,159,-290,-291,159,-340,-28,28,28,159,-184,-186,202,202,-152,-339,28,-145,-147,233,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,159,159,233,373,159,-77,-340,159,-340,-28,-73,-69,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,431,433,159,159,-287,159,159,159,28,28,-340,-171,202,159,-154,-156,-151,-143,-144,-148,159,-146,-130,-177,-178,-221,-220,233,233,-237,159,159,159,159,233,-87,-74,159,-233,-234,-236,159,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,159,-12,159,159,-287,159,159,159,-340,159,28,159,159,-172,-173,-153,-155,28,159,-222,233,-224,159,-86,-75,159,-232,-235,-340,-201,-340,-68,159,159,159,159,-340,-28,-287,-223,233,233,233,159,159,159,-11,-287,159,159,-225,-87,-74,-227,-228,159,-340,159,159,233,159,-226,-229,233,233,-231,-230,]),'LPAREN':([0,2,4,5,6,7,8,9,10,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,64,69,70,71,72,74,75,76,77,78,80,81,82,88,89,90,91,94,95,97,98,99,100,101,102,103,104,106,109,112,113,114,115,116,117,118,119,121,122,123,126,127,128,132,134,135,136,139,140,141,143,147,148,149,150,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,192,194,195,196,197,206,208,209,212,214,216,221,222,223,224,225,226,227,228,229,230,231,232,233,234,237,238,240,241,242,243,247,251,252,256,257,258,259,262,263,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,291,292,294,298,300,301,302,303,306,309,310,311,312,318,319,322,323,324,325,330,332,334,336,337,340,341,342,347,348,349,351,352,353,354,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,403,404,405,406,429,431,432,433,434,439,440,446,447,448,452,455,457,459,460,463,464,466,467,469,470,471,474,478,479,480,482,483,484,487,489,493,494,498,499,500,501,502,503,508,509,510,511,512,515,516,518,520,524,525,526,527,528,529,532,533,535,536,543,544,545,546,547,548,549,550,551,552,553,554,555,556,559,561,562,563,565,566,567,570,572,574,577,578,579,580,582,584,585,586,],[17,17,-60,-62,-63,-64,-65,-66,-67,82,-70,-71,92,17,94,96,17,-340,-340,-340,-128,-102,17,-340,-29,-107,-340,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,125,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,126,-61,82,17,-129,125,-98,-99,-100,-101,-104,82,-134,82,137,-37,-90,-72,141,-340,96,-93,-9,-10,-340,-94,-95,-103,-129,125,-97,-183,-27,-28,-185,-96,-169,-170,-338,-149,-150,141,-76,238,137,82,238,-340,-328,-30,238,-306,-287,-288,-289,-286,288,294,294,141,298,299,-292,-315,-290,-291,-304,-305,-307,304,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,238,-340,-28,322,82,238,-184,-186,-152,-339,82,-145,-147,351,238,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-315,141,362,238,366,367,238,372,238,-77,-38,-340,238,-340,-28,-73,-329,-69,238,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,238,238,-300,-301,238,238,-334,-335,-336,-337,-287,238,238,-35,-36,322,449,322,-340,-45,458,-171,141,-154,-156,-151,-143,-144,-148,141,-146,-130,351,351,-177,-178,-221,-220,238,238,-237,238,238,238,238,238,-87,-74,238,-233,-234,-236,238,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,238,-12,141,-287,238,238,-43,-44,141,-308,-295,-296,-297,-298,-299,-31,-34,449,458,-340,322,238,238,-172,-173,-153,-155,82,141,-222,238,-224,141,528,-86,-75,238,-232,-235,-340,-201,-39,-42,-340,-68,141,-293,-294,238,-32,-33,238,-340,-28,-210,-216,-214,-287,-223,238,238,238,238,238,238,-11,-40,-41,-287,238,238,-50,-51,-212,-211,-213,-215,-225,-87,-74,-227,-228,238,-302,-340,-309,238,-46,-49,238,238,-303,-47,-48,-226,-229,238,238,-231,-230,]),'TIMES':([0,2,4,5,6,7,8,9,10,12,14,15,17,21,22,23,24,25,26,27,29,30,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,69,70,71,72,74,75,76,77,78,81,82,90,91,94,95,98,99,100,101,102,103,104,106,112,113,114,115,116,117,118,119,121,122,123,126,127,128,134,135,136,139,141,143,145,146,147,148,149,150,151,152,153,154,155,156,158,159,160,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,192,194,195,197,206,208,209,212,214,216,221,222,223,224,225,226,227,228,229,230,231,232,233,234,238,242,247,250,251,256,257,258,259,262,263,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,291,292,293,294,295,296,297,298,300,301,302,303,306,309,310,322,323,330,332,334,336,337,340,341,342,347,348,349,351,353,354,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,448,455,457,459,460,463,464,466,467,469,470,471,474,479,480,482,483,484,487,489,497,498,499,500,501,502,503,505,506,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,561,562,563,565,570,572,574,579,580,582,584,585,586,],[30,30,-60,-62,-63,-64,-65,-66,-67,30,-70,-71,30,-340,-340,-340,-128,-102,30,-340,-107,-340,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,30,30,-129,-134,-98,-99,-100,-101,-104,-134,30,-90,-72,147,-340,-93,-9,-10,-340,-94,-95,-103,-129,-97,30,-27,-28,-185,-96,-169,-170,-338,-149,-150,147,-76,147,30,147,-340,-328,147,-306,269,-258,-287,-288,-289,-286,-277,-279,147,147,147,147,-292,-315,-290,-291,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,306,-340,-28,30,30,147,-186,-152,-339,30,-145,-147,30,147,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-315,147,147,147,147,-277,-77,-340,400,-340,-28,-73,-329,-69,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,-300,-301,-280,147,-281,-282,-283,147,-334,-335,-336,-337,-287,147,147,30,456,-171,147,-154,-156,-151,-143,-144,-148,147,-146,-130,30,-177,-178,-221,-220,147,147,-237,147,147,147,147,147,-87,-74,147,-233,-234,-236,147,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,147,-12,147,-287,147,147,147,-308,-259,-260,-261,269,269,269,269,269,269,269,269,269,269,269,269,269,269,269,-295,-296,-297,-298,-299,-340,147,520,-172,-173,-153,-155,30,147,-222,147,-224,147,-86,-75,147,-232,-235,-340,-201,-278,-340,-68,147,-293,-294,147,-284,-285,543,-340,-28,-287,-223,147,147,147,147,147,147,-11,-287,147,147,-225,-87,-74,-227,-228,147,-302,-340,-309,147,147,147,-303,-226,-229,147,147,-231,-230,]),'TYPEID':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,62,63,64,67,68,69,70,71,72,73,74,75,76,77,78,80,81,82,90,91,96,97,98,99,100,101,102,103,104,106,112,113,114,115,116,117,118,119,121,122,123,124,125,126,127,128,129,134,137,140,141,192,193,194,196,197,203,204,205,206,207,208,209,210,211,212,213,214,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,289,290,294,298,299,304,311,312,313,318,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,466,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[35,35,-60,-62,-63,-64,-65,-66,-67,35,89,-70,-71,-52,-340,-340,-340,-128,-102,35,-340,-29,-107,-340,-125,-126,-127,-129,-241,119,123,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-157,-158,-61,35,-91,89,35,-129,-134,35,-98,-99,-100,-101,-104,89,-134,89,-90,-72,35,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-183,-27,-28,-185,-96,-169,-170,-338,-149,-150,35,35,35,-76,35,-92,89,35,-30,35,324,35,89,-184,-186,35,35,35,-152,-159,-339,89,-162,-163,-145,35,-147,35,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,35,-77,-73,-69,432,434,35,35,35,35,-35,-36,35,324,35,-171,35,-154,35,-156,-151,-160,-143,-144,-148,-146,-130,35,-177,-178,-221,-220,-237,-87,-84,35,-233,-234,-236,-31,-34,35,35,-172,-173,-153,-155,-161,89,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'ENUM':([0,2,4,5,6,7,8,9,10,11,14,15,19,21,22,23,26,27,28,29,34,50,51,52,53,54,55,56,57,58,59,60,64,67,68,70,71,72,73,90,91,96,97,98,99,100,101,102,103,112,116,117,121,124,125,126,127,128,129,137,140,141,193,197,203,204,205,207,208,210,211,213,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,333,335,338,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[36,36,-60,-62,-63,-64,-65,-66,-67,36,-70,-71,-52,-340,-340,-340,36,-340,-29,-107,-340,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,36,-91,36,-340,-134,36,-90,-72,36,-53,-93,-9,-10,-340,-94,-95,-97,-185,-96,-338,36,36,36,-76,36,-92,36,-30,36,36,-186,36,36,36,-159,-339,-162,-163,36,36,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,36,-77,-73,-69,36,36,36,36,-35,-36,36,36,36,36,-160,-130,36,-177,-178,-221,-220,-237,-87,-84,36,-233,-234,-236,-31,-34,36,36,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'VOID':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[38,38,-60,-62,-63,-64,-65,-66,-67,38,38,-70,-71,-52,-340,-340,-340,-128,-102,38,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,38,-91,38,38,-129,-134,38,-98,-99,-100,-101,-104,-134,-90,-72,38,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,38,38,38,-76,38,-92,38,-30,38,38,38,-186,38,38,38,-152,-159,-339,38,-162,-163,-145,38,-147,38,38,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,38,-77,-73,-69,38,38,38,38,-35,-36,38,38,-171,38,-154,38,-156,-151,-160,-143,-144,-148,-146,-130,38,-177,-178,-221,-220,-237,-87,-84,38,-233,-234,-236,-31,-34,38,38,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'_BOOL':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[39,39,-60,-62,-63,-64,-65,-66,-67,39,39,-70,-71,-52,-340,-340,-340,-128,-102,39,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,39,-91,39,39,-129,-134,39,-98,-99,-100,-101,-104,-134,-90,-72,39,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,39,39,39,-76,39,-92,39,-30,39,39,39,-186,39,39,39,-152,-159,-339,39,-162,-163,-145,39,-147,39,39,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,39,-77,-73,-69,39,39,39,39,-35,-36,39,39,-171,39,-154,39,-156,-151,-160,-143,-144,-148,-146,-130,39,-177,-178,-221,-220,-237,-87,-84,39,-233,-234,-236,-31,-34,39,39,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'CHAR':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[40,40,-60,-62,-63,-64,-65,-66,-67,40,40,-70,-71,-52,-340,-340,-340,-128,-102,40,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,40,-91,40,40,-129,-134,40,-98,-99,-100,-101,-104,-134,-90,-72,40,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,40,40,40,-76,40,-92,40,-30,40,40,40,-186,40,40,40,-152,-159,-339,40,-162,-163,-145,40,-147,40,40,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,40,-77,-73,-69,40,40,40,40,-35,-36,40,40,-171,40,-154,40,-156,-151,-160,-143,-144,-148,-146,-130,40,-177,-178,-221,-220,-237,-87,-84,40,-233,-234,-236,-31,-34,40,40,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'SHORT':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[41,41,-60,-62,-63,-64,-65,-66,-67,41,41,-70,-71,-52,-340,-340,-340,-128,-102,41,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,41,-91,41,41,-129,-134,41,-98,-99,-100,-101,-104,-134,-90,-72,41,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,41,41,41,-76,41,-92,41,-30,41,41,41,-186,41,41,41,-152,-159,-339,41,-162,-163,-145,41,-147,41,41,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,41,-77,-73,-69,41,41,41,41,-35,-36,41,41,-171,41,-154,41,-156,-151,-160,-143,-144,-148,-146,-130,41,-177,-178,-221,-220,-237,-87,-84,41,-233,-234,-236,-31,-34,41,41,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'INT':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[42,42,-60,-62,-63,-64,-65,-66,-67,42,42,-70,-71,-52,-340,-340,-340,-128,-102,42,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,42,-91,42,42,-129,-134,42,-98,-99,-100,-101,-104,-134,-90,-72,42,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,42,42,42,-76,42,-92,42,-30,42,42,42,-186,42,42,42,-152,-159,-339,42,-162,-163,-145,42,-147,42,42,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,42,-77,-73,-69,42,42,42,42,-35,-36,42,42,-171,42,-154,42,-156,-151,-160,-143,-144,-148,-146,-130,42,-177,-178,-221,-220,-237,-87,-84,42,-233,-234,-236,-31,-34,42,42,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'LONG':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[43,43,-60,-62,-63,-64,-65,-66,-67,43,43,-70,-71,-52,-340,-340,-340,-128,-102,43,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,43,-91,43,43,-129,-134,43,-98,-99,-100,-101,-104,-134,-90,-72,43,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,43,43,43,-76,43,-92,43,-30,43,43,43,-186,43,43,43,-152,-159,-339,43,-162,-163,-145,43,-147,43,43,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,43,-77,-73,-69,43,43,43,43,-35,-36,43,43,-171,43,-154,43,-156,-151,-160,-143,-144,-148,-146,-130,43,-177,-178,-221,-220,-237,-87,-84,43,-233,-234,-236,-31,-34,43,43,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'FLOAT':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[44,44,-60,-62,-63,-64,-65,-66,-67,44,44,-70,-71,-52,-340,-340,-340,-128,-102,44,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,44,-91,44,44,-129,-134,44,-98,-99,-100,-101,-104,-134,-90,-72,44,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,44,44,44,-76,44,-92,44,-30,44,44,44,-186,44,44,44,-152,-159,-339,44,-162,-163,-145,44,-147,44,44,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,44,-77,-73,-69,44,44,44,44,-35,-36,44,44,-171,44,-154,44,-156,-151,-160,-143,-144,-148,-146,-130,44,-177,-178,-221,-220,-237,-87,-84,44,-233,-234,-236,-31,-34,44,44,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'DOUBLE':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[45,45,-60,-62,-63,-64,-65,-66,-67,45,45,-70,-71,-52,-340,-340,-340,-128,-102,45,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,45,-91,45,45,-129,-134,45,-98,-99,-100,-101,-104,-134,-90,-72,45,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,45,45,45,-76,45,-92,45,-30,45,45,45,-186,45,45,45,-152,-159,-339,45,-162,-163,-145,45,-147,45,45,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,45,-77,-73,-69,45,45,45,45,-35,-36,45,45,-171,45,-154,45,-156,-151,-160,-143,-144,-148,-146,-130,45,-177,-178,-221,-220,-237,-87,-84,45,-233,-234,-236,-31,-34,45,45,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'_COMPLEX':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[46,46,-60,-62,-63,-64,-65,-66,-67,46,46,-70,-71,-52,-340,-340,-340,-128,-102,46,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,46,-91,46,46,-129,-134,46,-98,-99,-100,-101,-104,-134,-90,-72,46,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,46,46,46,-76,46,-92,46,-30,46,46,46,-186,46,46,46,-152,-159,-339,46,-162,-163,-145,46,-147,46,46,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,46,-77,-73,-69,46,46,46,46,-35,-36,46,46,-171,46,-154,46,-156,-151,-160,-143,-144,-148,-146,-130,46,-177,-178,-221,-220,-237,-87,-84,46,-233,-234,-236,-31,-34,46,46,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'SIGNED':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[47,47,-60,-62,-63,-64,-65,-66,-67,47,47,-70,-71,-52,-340,-340,-340,-128,-102,47,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,47,-91,47,47,-129,-134,47,-98,-99,-100,-101,-104,-134,-90,-72,47,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,47,47,47,-76,47,-92,47,-30,47,47,47,-186,47,47,47,-152,-159,-339,47,-162,-163,-145,47,-147,47,47,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,47,-77,-73,-69,47,47,47,47,-35,-36,47,47,-171,47,-154,47,-156,-151,-160,-143,-144,-148,-146,-130,47,-177,-178,-221,-220,-237,-87,-84,47,-233,-234,-236,-31,-34,47,47,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'UNSIGNED':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[48,48,-60,-62,-63,-64,-65,-66,-67,48,48,-70,-71,-52,-340,-340,-340,-128,-102,48,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,48,-91,48,48,-129,-134,48,-98,-99,-100,-101,-104,-134,-90,-72,48,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,48,48,48,-76,48,-92,48,-30,48,48,48,-186,48,48,48,-152,-159,-339,48,-162,-163,-145,48,-147,48,48,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,48,-77,-73,-69,48,48,48,48,-35,-36,48,48,-171,48,-154,48,-156,-151,-160,-143,-144,-148,-146,-130,48,-177,-178,-221,-220,-237,-87,-84,48,-233,-234,-236,-31,-34,48,48,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'__INT128':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,96,97,98,99,100,101,102,103,104,106,112,116,117,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[49,49,-60,-62,-63,-64,-65,-66,-67,49,49,-70,-71,-52,-340,-340,-340,-128,-102,49,-340,-29,-107,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,49,-91,49,49,-129,-134,49,-98,-99,-100,-101,-104,-134,-90,-72,49,-53,-93,-9,-10,-340,-94,-95,-103,-129,-97,-185,-96,-169,-170,-338,-149,-150,49,49,49,-76,49,-92,49,-30,49,49,49,-186,49,49,49,-152,-159,-339,49,-162,-163,-145,49,-147,49,49,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,49,-77,-73,-69,49,49,49,49,-35,-36,49,49,-171,49,-154,49,-156,-151,-160,-143,-144,-148,-146,-130,49,-177,-178,-221,-220,-237,-87,-84,49,-233,-234,-236,-31,-34,49,49,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'_ATOMIC':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,70,71,72,73,74,75,76,77,78,81,90,91,95,96,97,98,99,100,101,102,103,104,106,112,115,116,117,118,119,121,122,123,124,125,126,127,128,129,136,137,140,141,183,184,192,193,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,258,259,262,267,294,298,299,304,311,312,313,322,323,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,448,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,511,512,524,552,553,554,555,556,579,580,585,586,],[50,50,-60,-62,-63,-64,-65,-66,-67,72,81,-70,-71,-52,72,72,72,-128,-102,109,72,-29,-107,81,-125,-126,-127,72,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,72,-91,81,109,72,-134,72,-98,-99,-100,-101,-104,-134,-90,-72,81,50,-53,-93,-9,-10,72,-94,-95,-103,-129,-97,81,-185,-96,-169,-170,-338,-149,-150,50,50,50,-76,72,-92,81,50,-30,50,81,81,81,109,-186,50,50,50,-152,-159,-339,81,-162,-163,-145,72,-147,81,72,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,50,-77,81,81,-73,-69,50,50,50,50,-35,-36,50,50,81,-171,50,-154,50,-156,-151,-160,-143,-144,-148,-146,-130,50,-177,-178,-221,-220,-237,-87,-84,72,-233,-234,-236,-31,-34,81,50,50,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,81,81,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'CONST':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,30,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,95,96,97,101,104,106,115,116,118,119,121,122,123,124,125,126,127,128,129,136,137,140,141,183,184,192,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,258,259,262,267,294,298,299,304,311,312,313,322,323,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,448,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,511,512,524,552,553,554,555,556,579,580,585,586,],[51,51,-60,-62,-63,-64,-65,-66,-67,51,51,-70,-71,-52,51,51,51,-128,-102,51,-29,-107,51,-125,-126,-127,51,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,51,-91,51,51,-134,51,-98,-99,-100,-101,-104,-134,-90,-72,51,51,-53,51,-103,-129,51,-185,-169,-170,-338,-149,-150,51,51,51,-76,51,-92,51,51,-30,51,51,51,51,-186,51,51,51,-152,-159,-339,51,-162,-163,-145,51,-147,51,51,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,51,-77,51,51,-73,-69,51,51,51,51,-35,-36,51,51,51,-171,51,-154,51,-156,-151,-160,-143,-144,-148,-146,-130,51,-177,-178,-221,-220,-237,-87,-84,51,-233,-234,-236,-31,-34,51,51,51,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,51,51,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'RESTRICT':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,30,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,95,96,97,101,104,106,115,116,118,119,121,122,123,124,125,126,127,128,129,136,137,140,141,183,184,192,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,258,259,262,267,294,298,299,304,311,312,313,322,323,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,448,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,511,512,524,552,553,554,555,556,579,580,585,586,],[52,52,-60,-62,-63,-64,-65,-66,-67,52,52,-70,-71,-52,52,52,52,-128,-102,52,-29,-107,52,-125,-126,-127,52,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,52,-91,52,52,-134,52,-98,-99,-100,-101,-104,-134,-90,-72,52,52,-53,52,-103,-129,52,-185,-169,-170,-338,-149,-150,52,52,52,-76,52,-92,52,52,-30,52,52,52,52,-186,52,52,52,-152,-159,-339,52,-162,-163,-145,52,-147,52,52,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,52,-77,52,52,-73,-69,52,52,52,52,-35,-36,52,52,52,-171,52,-154,52,-156,-151,-160,-143,-144,-148,-146,-130,52,-177,-178,-221,-220,-237,-87,-84,52,-233,-234,-236,-31,-34,52,52,52,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,52,52,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'VOLATILE':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,30,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,95,96,97,101,104,106,115,116,118,119,121,122,123,124,125,126,127,128,129,136,137,140,141,183,184,192,197,203,204,205,206,207,208,209,210,211,212,213,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,258,259,262,267,294,298,299,304,311,312,313,322,323,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,448,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,511,512,524,552,553,554,555,556,579,580,585,586,],[53,53,-60,-62,-63,-64,-65,-66,-67,53,53,-70,-71,-52,53,53,53,-128,-102,53,-29,-107,53,-125,-126,-127,53,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,53,-91,53,53,-134,53,-98,-99,-100,-101,-104,-134,-90,-72,53,53,-53,53,-103,-129,53,-185,-169,-170,-338,-149,-150,53,53,53,-76,53,-92,53,53,-30,53,53,53,53,-186,53,53,53,-152,-159,-339,53,-162,-163,-145,53,-147,53,53,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,53,-77,53,53,-73,-69,53,53,53,53,-35,-36,53,53,53,-171,53,-154,53,-156,-151,-160,-143,-144,-148,-146,-130,53,-177,-178,-221,-220,-237,-87,-84,53,-233,-234,-236,-31,-34,53,53,53,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,53,53,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'AUTO':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,96,97,101,104,106,118,119,121,122,123,127,128,129,137,140,192,206,208,221,222,223,224,225,226,227,228,229,230,231,232,251,262,267,311,312,313,322,330,334,336,337,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[54,54,-60,-62,-63,-64,-65,-66,-67,54,54,-70,-71,-52,54,54,54,-128,-102,54,-29,-107,-125,-126,-127,54,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,54,-91,54,54,-134,54,-98,-99,-100,-101,-104,-134,-90,-72,54,-53,54,-103,-129,-169,-170,-338,-149,-150,-76,54,-92,54,-30,54,-152,-339,54,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-77,-73,-69,-35,-36,54,54,-171,-154,-156,-151,-130,54,-177,-178,-221,-220,-237,-87,-84,54,-233,-234,-236,-31,-34,54,54,-172,-173,-153,-155,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'REGISTER':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,96,97,101,104,106,118,119,121,122,123,127,128,129,137,140,192,206,208,221,222,223,224,225,226,227,228,229,230,231,232,251,262,267,311,312,313,322,330,334,336,337,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[55,55,-60,-62,-63,-64,-65,-66,-67,55,55,-70,-71,-52,55,55,55,-128,-102,55,-29,-107,-125,-126,-127,55,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,55,-91,55,55,-134,55,-98,-99,-100,-101,-104,-134,-90,-72,55,-53,55,-103,-129,-169,-170,-338,-149,-150,-76,55,-92,55,-30,55,-152,-339,55,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-77,-73,-69,-35,-36,55,55,-171,-154,-156,-151,-130,55,-177,-178,-221,-220,-237,-87,-84,55,-233,-234,-236,-31,-34,55,55,-172,-173,-153,-155,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'STATIC':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,95,96,97,101,104,106,116,118,119,121,122,123,127,128,129,136,137,140,184,192,197,206,208,221,222,223,224,225,226,227,228,229,230,231,232,251,259,262,267,311,312,313,322,330,334,336,337,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,448,449,458,459,460,463,464,469,471,479,480,483,484,499,508,509,512,524,552,553,554,555,556,579,580,585,586,],[29,29,-60,-62,-63,-64,-65,-66,-67,29,29,-70,-71,-52,29,29,29,-128,-102,29,-29,-107,-125,-126,-127,29,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,29,-91,29,29,-134,29,-98,-99,-100,-101,-104,-134,-90,-72,183,29,-53,29,-103,-129,-185,-169,-170,-338,-149,-150,-76,29,-92,258,29,-30,310,29,-186,-152,-339,29,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-77,402,-73,-69,-35,-36,29,29,-171,-154,-156,-151,-130,29,-177,-178,-221,-220,-237,-87,-84,29,-233,-234,-236,-31,-34,511,29,29,-172,-173,-153,-155,-222,-224,-86,-84,-232,-235,-68,-32,-33,545,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'EXTERN':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,96,97,101,104,106,118,119,121,122,123,127,128,129,137,140,192,206,208,221,222,223,224,225,226,227,228,229,230,231,232,251,262,267,311,312,313,322,330,334,336,337,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[56,56,-60,-62,-63,-64,-65,-66,-67,56,56,-70,-71,-52,56,56,56,-128,-102,56,-29,-107,-125,-126,-127,56,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,56,-91,56,56,-134,56,-98,-99,-100,-101,-104,-134,-90,-72,56,-53,56,-103,-129,-169,-170,-338,-149,-150,-76,56,-92,56,-30,56,-152,-339,56,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-77,-73,-69,-35,-36,56,56,-171,-154,-156,-151,-130,56,-177,-178,-221,-220,-237,-87,-84,56,-233,-234,-236,-31,-34,56,56,-172,-173,-153,-155,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'TYPEDEF':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,96,97,101,104,106,118,119,121,122,123,127,128,129,137,140,192,206,208,221,222,223,224,225,226,227,228,229,230,231,232,251,262,267,311,312,313,322,330,334,336,337,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[57,57,-60,-62,-63,-64,-65,-66,-67,57,57,-70,-71,-52,57,57,57,-128,-102,57,-29,-107,-125,-126,-127,57,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,57,-91,57,57,-134,57,-98,-99,-100,-101,-104,-134,-90,-72,57,-53,57,-103,-129,-169,-170,-338,-149,-150,-76,57,-92,57,-30,57,-152,-339,57,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-77,-73,-69,-35,-36,57,57,-171,-154,-156,-151,-130,57,-177,-178,-221,-220,-237,-87,-84,57,-233,-234,-236,-31,-34,57,57,-172,-173,-153,-155,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'_THREAD_LOCAL':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,96,97,101,104,106,118,119,121,122,123,127,128,129,137,140,192,206,208,221,222,223,224,225,226,227,228,229,230,231,232,251,262,267,311,312,313,322,330,334,336,337,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[58,58,-60,-62,-63,-64,-65,-66,-67,58,58,-70,-71,-52,58,58,58,-128,-102,58,-29,-107,-125,-126,-127,58,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,58,-91,58,58,-134,58,-98,-99,-100,-101,-104,-134,-90,-72,58,-53,58,-103,-129,-169,-170,-338,-149,-150,-76,58,-92,58,-30,58,-152,-339,58,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-77,-73,-69,-35,-36,58,58,-171,-154,-156,-151,-130,58,-177,-178,-221,-220,-237,-87,-84,58,-233,-234,-236,-31,-34,58,58,-172,-173,-153,-155,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'INLINE':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,96,97,101,104,106,118,119,121,122,123,127,128,129,137,140,192,206,208,221,222,223,224,225,226,227,228,229,230,231,232,251,262,267,311,312,313,322,330,334,336,337,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[59,59,-60,-62,-63,-64,-65,-66,-67,59,59,-70,-71,-52,59,59,59,-128,-102,59,-29,-107,-125,-126,-127,59,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,59,-91,59,59,-134,59,-98,-99,-100,-101,-104,-134,-90,-72,59,-53,59,-103,-129,-169,-170,-338,-149,-150,-76,59,-92,59,-30,59,-152,-339,59,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-77,-73,-69,-35,-36,59,59,-171,-154,-156,-151,-130,59,-177,-178,-221,-220,-237,-87,-84,59,-233,-234,-236,-31,-34,59,59,-172,-173,-153,-155,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'_NORETURN':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,96,97,101,104,106,118,119,121,122,123,127,128,129,137,140,192,206,208,221,222,223,224,225,226,227,228,229,230,231,232,251,262,267,311,312,313,322,330,334,336,337,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[60,60,-60,-62,-63,-64,-65,-66,-67,60,60,-70,-71,-52,60,60,60,-128,-102,60,-29,-107,-125,-126,-127,60,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,60,-91,60,60,-134,60,-98,-99,-100,-101,-104,-134,-90,-72,60,-53,60,-103,-129,-169,-170,-338,-149,-150,-76,60,-92,60,-30,60,-152,-339,60,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-77,-73,-69,-35,-36,60,60,-171,-154,-156,-151,-130,60,-177,-178,-221,-220,-237,-87,-84,60,-233,-234,-236,-31,-34,60,60,-172,-173,-153,-155,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'_ALIGNAS':([0,2,4,5,6,7,8,9,10,11,12,14,15,19,21,22,23,24,25,27,28,29,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,64,67,68,69,71,72,73,74,75,76,77,78,81,90,91,96,97,101,104,106,118,119,121,122,123,124,125,126,127,128,129,137,140,141,192,203,204,205,206,207,208,209,210,211,212,214,216,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,330,333,334,335,336,337,338,340,341,342,348,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,459,460,463,464,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[61,61,-60,-62,-63,-64,-65,-66,-67,61,61,-70,-71,-52,61,61,61,-128,-102,61,-29,-107,-125,-126,-127,61,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,61,-91,61,61,-134,61,-98,-99,-100,-101,-104,-134,-90,-72,61,-53,61,-103,-129,-169,-170,-338,-149,-150,61,61,61,-76,61,-92,61,-30,61,61,61,61,61,-152,-159,-339,61,-162,-163,-145,-147,61,61,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,61,-77,-73,-69,61,61,61,61,-35,-36,61,61,-171,61,-154,61,-156,-151,-160,-143,-144,-148,-146,-130,61,-177,-178,-221,-220,-237,-87,-84,61,-233,-234,-236,-31,-34,61,61,-172,-173,-153,-155,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'STRUCT':([0,2,4,5,6,7,8,9,10,11,14,15,19,21,22,23,26,27,28,29,34,50,51,52,53,54,55,56,57,58,59,60,64,67,68,70,71,72,73,90,91,96,97,98,99,100,101,102,103,112,116,117,121,124,125,126,127,128,129,137,140,141,193,197,203,204,205,207,208,210,211,213,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,333,335,338,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[62,62,-60,-62,-63,-64,-65,-66,-67,62,-70,-71,-52,-340,-340,-340,62,-340,-29,-107,-340,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,62,-91,62,-340,-134,62,-90,-72,62,-53,-93,-9,-10,-340,-94,-95,-97,-185,-96,-338,62,62,62,-76,62,-92,62,-30,62,62,-186,62,62,62,-159,-339,-162,-163,62,62,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,62,-77,-73,-69,62,62,62,62,-35,-36,62,62,62,62,-160,-130,62,-177,-178,-221,-220,-237,-87,-84,62,-233,-234,-236,-31,-34,62,62,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'UNION':([0,2,4,5,6,7,8,9,10,11,14,15,19,21,22,23,26,27,28,29,34,50,51,52,53,54,55,56,57,58,59,60,64,67,68,70,71,72,73,90,91,96,97,98,99,100,101,102,103,112,116,117,121,124,125,126,127,128,129,137,140,141,193,197,203,204,205,207,208,210,211,213,221,222,223,224,225,226,227,228,229,230,231,232,238,251,262,267,294,298,299,304,311,312,313,322,333,335,338,349,351,353,354,355,356,361,370,371,372,374,375,377,439,440,449,458,465,469,471,479,480,483,484,499,508,509,524,552,553,554,555,556,579,580,585,586,],[63,63,-60,-62,-63,-64,-65,-66,-67,63,-70,-71,-52,-340,-340,-340,63,-340,-29,-107,-340,-134,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-61,63,-91,63,-340,-134,63,-90,-72,63,-53,-93,-9,-10,-340,-94,-95,-97,-185,-96,-338,63,63,63,-76,63,-92,63,-30,63,63,-186,63,63,63,-159,-339,-162,-163,63,63,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,63,-77,-73,-69,63,63,63,63,-35,-36,63,63,63,63,-160,-130,63,-177,-178,-221,-220,-237,-87,-84,63,-233,-234,-236,-31,-34,63,63,-161,-222,-224,-86,-84,-232,-235,-68,-32,-33,-223,-225,-87,-84,-227,-228,-226,-229,-231,-230,]),'LBRACE':([11,15,19,28,36,37,62,63,65,66,67,68,73,90,91,97,118,119,121,122,123,128,129,131,135,140,195,208,221,222,223,224,225,226,227,228,229,230,231,232,238,242,256,262,267,311,312,355,356,358,360,361,369,370,371,374,375,377,392,393,394,405,439,440,469,470,471,474,479,480,483,484,487,489,498,499,504,505,508,509,524,525,526,527,532,533,552,553,554,555,556,562,570,579,580,582,584,585,586,],[-340,-71,-52,-29,121,121,-157,-158,121,-7,-8,-91,-340,-90,-72,-53,121,121,-338,121,121,121,-92,121,121,-30,121,-339,121,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,121,121,-340,-73,-69,-35,-36,-221,-220,121,121,-237,121,-87,-74,-233,-234,-236,-11,121,-12,121,-31,-34,-222,121,-224,121,-86,-75,-232,-235,-340,-201,-340,-68,121,121,-32,-33,-223,121,121,121,121,-11,-225,-87,-74,-227,-228,-340,121,-226,-229,121,121,-231,-230,]),'RBRACE':([15,90,91,121,124,128,139,143,144,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,200,201,202,203,204,205,207,208,210,211,219,220,221,222,223,224,225,226,227,228,229,230,231,232,249,250,255,256,262,263,267,291,292,293,295,296,297,300,301,302,303,328,329,331,333,335,338,355,356,361,370,371,374,375,377,390,391,392,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,461,462,465,469,471,473,479,480,483,484,485,486,487,488,497,499,501,502,505,506,524,531,537,538,552,553,554,555,556,560,561,562,563,574,579,580,585,586,],[-71,-90,-72,-338,208,-340,-328,-306,-255,-256,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,208,-174,-179,208,208,208,-159,-339,-162,-163,208,-5,-6,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-242,-277,-196,-340,-73,-329,-69,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,208,208,-175,208,208,-160,-221,-220,-237,-87,-84,-233,-234,-236,208,-22,-21,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-274,-275,-276,-295,-296,-297,-298,-299,-176,-180,-161,-222,-224,-240,-86,-84,-232,-235,-243,-197,208,-199,-278,-68,-293,-294,-284,-285,-223,-198,208,-257,-225,-87,-84,-227,-228,-200,-302,208,-309,-303,-226,-229,-231,-230,]),'CASE':([15,90,91,121,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,262,267,355,356,358,360,361,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[-71,-90,-72,-338,234,-339,234,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,234,-73,-69,-221,-220,234,234,-237,234,-87,-74,-233,-234,-236,-222,234,-224,-86,-75,-232,-235,-68,-223,234,234,234,-225,-87,-74,-227,-228,234,-226,-229,234,234,-231,-230,]),'DEFAULT':([15,90,91,121,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,262,267,355,356,358,360,361,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[-71,-90,-72,-338,235,-339,235,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,235,-73,-69,-221,-220,235,235,-237,235,-87,-74,-233,-234,-236,-222,235,-224,-86,-75,-232,-235,-68,-223,235,235,235,-225,-87,-74,-227,-228,235,-226,-229,235,235,-231,-230,]),'IF':([15,90,91,121,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,262,267,355,356,358,360,361,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[-71,-90,-72,-338,237,-339,237,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,237,-73,-69,-221,-220,237,237,-237,237,-87,-74,-233,-234,-236,-222,237,-224,-86,-75,-232,-235,-68,-223,237,237,237,-225,-87,-74,-227,-228,237,-226,-229,237,237,-231,-230,]),'SWITCH':([15,90,91,121,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,262,267,355,356,358,360,361,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[-71,-90,-72,-338,240,-339,240,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,240,-73,-69,-221,-220,240,240,-237,240,-87,-74,-233,-234,-236,-222,240,-224,-86,-75,-232,-235,-68,-223,240,240,240,-225,-87,-74,-227,-228,240,-226,-229,240,240,-231,-230,]),'WHILE':([15,90,91,121,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,262,267,355,356,358,360,361,368,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[-71,-90,-72,-338,241,-339,241,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,241,-73,-69,-221,-220,241,241,-237,478,241,-87,-74,-233,-234,-236,-222,241,-224,-86,-75,-232,-235,-68,-223,241,241,241,-225,-87,-74,-227,-228,241,-226,-229,241,241,-231,-230,]),'DO':([15,90,91,121,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,262,267,355,356,358,360,361,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[-71,-90,-72,-338,242,-339,242,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,242,-73,-69,-221,-220,242,242,-237,242,-87,-74,-233,-234,-236,-222,242,-224,-86,-75,-232,-235,-68,-223,242,242,242,-225,-87,-74,-227,-228,242,-226,-229,242,242,-231,-230,]),'FOR':([15,90,91,121,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,262,267,355,356,358,360,361,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[-71,-90,-72,-338,243,-339,243,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,243,-73,-69,-221,-220,243,243,-237,243,-87,-74,-233,-234,-236,-222,243,-224,-86,-75,-232,-235,-68,-223,243,243,243,-225,-87,-74,-227,-228,243,-226,-229,243,243,-231,-230,]),'GOTO':([15,90,91,121,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,262,267,355,356,358,360,361,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[-71,-90,-72,-338,244,-339,244,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,244,-73,-69,-221,-220,244,244,-237,244,-87,-74,-233,-234,-236,-222,244,-224,-86,-75,-232,-235,-68,-223,244,244,244,-225,-87,-74,-227,-228,244,-226,-229,244,244,-231,-230,]),'BREAK':([15,90,91,121,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,262,267,355,356,358,360,361,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[-71,-90,-72,-338,245,-339,245,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,245,-73,-69,-221,-220,245,245,-237,245,-87,-74,-233,-234,-236,-222,245,-224,-86,-75,-232,-235,-68,-223,245,245,245,-225,-87,-74,-227,-228,245,-226,-229,245,245,-231,-230,]),'CONTINUE':([15,90,91,121,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,262,267,355,356,358,360,361,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[-71,-90,-72,-338,246,-339,246,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,246,-73,-69,-221,-220,246,246,-237,246,-87,-74,-233,-234,-236,-222,246,-224,-86,-75,-232,-235,-68,-223,246,246,246,-225,-87,-74,-227,-228,246,-226,-229,246,246,-231,-230,]),'RETURN':([15,90,91,121,128,208,221,222,223,224,225,226,227,228,229,230,231,232,242,262,267,355,356,358,360,361,369,370,371,374,375,377,469,470,471,479,480,483,484,499,524,525,526,527,552,553,554,555,556,570,579,580,582,584,585,586,],[-71,-90,-72,-338,247,-339,247,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,247,-73,-69,-221,-220,247,247,-237,247,-87,-74,-233,-234,-236,-222,247,-224,-86,-75,-232,-235,-68,-223,247,247,247,-225,-87,-74,-227,-228,247,-226,-229,247,247,-231,-230,]),'PLUSPLUS':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,139,141,143,147,148,149,150,152,153,154,155,156,158,159,160,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,233,234,238,242,247,256,257,258,259,262,263,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,291,292,294,298,300,301,302,303,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,406,429,431,432,433,434,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,501,502,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,561,562,563,565,570,572,574,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,153,-340,-27,-28,-185,-338,153,153,153,-340,-328,153,-306,-287,-288,-289,-286,291,153,153,153,153,-292,-315,-290,-291,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,153,-340,-28,153,-186,-339,153,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-315,153,153,153,153,-340,153,-340,-28,-73,-329,-69,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,-300,-301,153,153,-334,-335,-336,-337,-287,153,153,-340,153,153,-221,-220,153,153,-237,153,153,153,153,153,-87,-74,153,-233,-234,-236,153,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,153,-12,153,-287,153,153,153,-308,-295,-296,-297,-298,-299,-340,153,153,153,-222,153,-224,153,-86,-75,153,-232,-235,-340,-201,-340,-68,153,-293,-294,153,153,-340,-28,-287,-223,153,153,153,153,153,153,-11,-287,153,153,-225,-87,-74,-227,-228,153,-302,-340,-309,153,153,153,-303,-226,-229,153,153,-231,-230,]),'MINUSMINUS':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,139,141,143,147,148,149,150,152,153,154,155,156,158,159,160,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,233,234,238,242,247,256,257,258,259,262,263,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,291,292,294,298,300,301,302,303,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,406,429,431,432,433,434,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,501,502,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,561,562,563,565,570,572,574,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,154,-340,-27,-28,-185,-338,154,154,154,-340,-328,154,-306,-287,-288,-289,-286,292,154,154,154,154,-292,-315,-290,-291,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,154,-340,-28,154,-186,-339,154,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-315,154,154,154,154,-340,154,-340,-28,-73,-329,-69,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,-300,-301,154,154,-334,-335,-336,-337,-287,154,154,-340,154,154,-221,-220,154,154,-237,154,154,154,154,154,-87,-74,154,-233,-234,-236,154,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,154,-12,154,-287,154,154,154,-308,-295,-296,-297,-298,-299,-340,154,154,154,-222,154,-224,154,-86,-75,154,-232,-235,-340,-201,-340,-68,154,-293,-294,154,154,-340,-28,-287,-223,154,154,154,154,154,154,-11,-287,154,154,-225,-87,-74,-227,-228,154,-302,-340,-309,154,154,154,-303,-226,-229,154,154,-231,-230,]),'SIZEOF':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,156,-340,-27,-28,-185,-338,156,156,156,-340,156,-287,-288,-289,-286,156,156,156,156,-290,-291,156,-340,-28,156,-186,-339,156,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,156,156,156,156,-340,156,-340,-28,-73,-69,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,-287,156,156,-340,156,156,-221,-220,156,156,-237,156,156,156,156,156,-87,-74,156,-233,-234,-236,156,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,156,-12,156,-287,156,156,156,-340,156,156,156,-222,156,-224,156,-86,-75,156,-232,-235,-340,-201,-340,-68,156,156,156,-340,-28,-287,-223,156,156,156,156,156,156,-11,-287,156,156,-225,-87,-74,-227,-228,156,-340,156,156,156,-226,-229,156,156,-231,-230,]),'_ALIGNOF':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,157,-340,-27,-28,-185,-338,157,157,157,-340,157,-287,-288,-289,-286,157,157,157,157,-290,-291,157,-340,-28,157,-186,-339,157,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,157,157,157,157,-340,157,-340,-28,-73,-69,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,-287,157,157,-340,157,157,-221,-220,157,157,-237,157,157,157,157,157,-87,-74,157,-233,-234,-236,157,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,157,-12,157,-287,157,157,157,-340,157,157,157,-222,157,-224,157,-86,-75,157,-232,-235,-340,-201,-340,-68,157,157,157,-340,-28,-287,-223,157,157,157,157,157,157,-11,-287,157,157,-225,-87,-74,-227,-228,157,-340,157,157,157,-226,-229,157,157,-231,-230,]),'AND':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,139,141,143,145,146,147,148,149,150,151,152,153,154,155,156,158,159,160,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,233,234,238,242,247,250,256,257,258,259,262,263,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,291,292,293,294,295,296,297,298,300,301,302,303,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,497,498,499,500,501,502,503,505,506,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,561,562,563,565,570,572,574,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,150,-340,-27,-28,-185,-338,150,150,150,-340,-328,150,-306,282,-258,-287,-288,-289,-286,-277,-279,150,150,150,150,-292,-315,-290,-291,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,150,-340,-28,150,-186,-339,150,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-315,150,150,150,150,-277,-340,150,-340,-28,-73,-329,-69,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,-300,-301,-280,150,-281,-282,-283,150,-334,-335,-336,-337,-287,150,150,-340,150,150,-221,-220,150,150,-237,150,150,150,150,150,-87,-74,150,-233,-234,-236,150,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,150,-12,150,-287,150,150,150,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,282,282,282,282,-295,-296,-297,-298,-299,-340,150,150,150,-222,150,-224,150,-86,-75,150,-232,-235,-340,-201,-278,-340,-68,150,-293,-294,150,-284,-285,150,-340,-28,-287,-223,150,150,150,150,150,150,-11,-287,150,150,-225,-87,-74,-227,-228,150,-302,-340,-309,150,150,150,-303,-226,-229,150,150,-231,-230,]),'PLUS':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,139,141,143,145,146,147,148,149,150,151,152,153,154,155,156,158,159,160,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,233,234,238,242,247,250,256,257,258,259,262,263,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,291,292,293,294,295,296,297,298,300,301,302,303,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,497,498,499,500,501,502,503,505,506,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,561,562,563,565,570,572,574,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,148,-340,-27,-28,-185,-338,148,148,148,-340,-328,148,-306,272,-258,-287,-288,-289,-286,-277,-279,148,148,148,148,-292,-315,-290,-291,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,148,-340,-28,148,-186,-339,148,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-315,148,148,148,148,-277,-340,148,-340,-28,-73,-329,-69,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,-300,-301,-280,148,-281,-282,-283,148,-334,-335,-336,-337,-287,148,148,-340,148,148,-221,-220,148,148,-237,148,148,148,148,148,-87,-74,148,-233,-234,-236,148,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,148,-12,148,-287,148,148,148,-308,-259,-260,-261,-262,-263,272,272,272,272,272,272,272,272,272,272,272,272,272,-295,-296,-297,-298,-299,-340,148,148,148,-222,148,-224,148,-86,-75,148,-232,-235,-340,-201,-278,-340,-68,148,-293,-294,148,-284,-285,148,-340,-28,-287,-223,148,148,148,148,148,148,-11,-287,148,148,-225,-87,-74,-227,-228,148,-302,-340,-309,148,148,148,-303,-226,-229,148,148,-231,-230,]),'MINUS':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,139,141,143,145,146,147,148,149,150,151,152,153,154,155,156,158,159,160,161,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,233,234,238,242,247,250,256,257,258,259,262,263,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,291,292,293,294,295,296,297,298,300,301,302,303,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,497,498,499,500,501,502,503,505,506,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,561,562,563,565,570,572,574,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,149,-340,-27,-28,-185,-338,149,149,149,-340,-328,149,-306,273,-258,-287,-288,-289,-286,-277,-279,149,149,149,149,-292,-315,-290,-291,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,149,-340,-28,149,-186,-339,149,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,-315,149,149,149,149,-277,-340,149,-340,-28,-73,-329,-69,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,-300,-301,-280,149,-281,-282,-283,149,-334,-335,-336,-337,-287,149,149,-340,149,149,-221,-220,149,149,-237,149,149,149,149,149,-87,-74,149,-233,-234,-236,149,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,149,-12,149,-287,149,149,149,-308,-259,-260,-261,-262,-263,273,273,273,273,273,273,273,273,273,273,273,273,273,-295,-296,-297,-298,-299,-340,149,149,149,-222,149,-224,149,-86,-75,149,-232,-235,-340,-201,-278,-340,-68,149,-293,-294,149,-284,-285,149,-340,-28,-287,-223,149,149,149,149,149,149,-11,-287,149,149,-225,-87,-74,-227,-228,149,-302,-340,-309,149,149,149,-303,-226,-229,149,149,-231,-230,]),'NOT':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,160,-340,-27,-28,-185,-338,160,160,160,-340,160,-287,-288,-289,-286,160,160,160,160,-290,-291,160,-340,-28,160,-186,-339,160,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,160,160,160,160,-340,160,-340,-28,-73,-69,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,-287,160,160,-340,160,160,-221,-220,160,160,-237,160,160,160,160,160,-87,-74,160,-233,-234,-236,160,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,160,-12,160,-287,160,160,160,-340,160,160,160,-222,160,-224,160,-86,-75,160,-232,-235,-340,-201,-340,-68,160,160,160,-340,-28,-287,-223,160,160,160,160,160,160,-11,-287,160,160,-225,-87,-74,-227,-228,160,-340,160,160,160,-226,-229,160,160,-231,-230,]),'LNOT':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,161,-340,-27,-28,-185,-338,161,161,161,-340,161,-287,-288,-289,-286,161,161,161,161,-290,-291,161,-340,-28,161,-186,-339,161,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,161,161,161,161,-340,161,-340,-28,-73,-69,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,-287,161,161,-340,161,161,-221,-220,161,161,-237,161,161,161,161,161,-87,-74,161,-233,-234,-236,161,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,161,-12,161,-287,161,161,161,-340,161,161,161,-222,161,-224,161,-86,-75,161,-232,-235,-340,-201,-340,-68,161,161,161,-340,-28,-287,-223,161,161,161,161,161,161,-11,-287,161,161,-225,-87,-74,-227,-228,161,-340,161,161,161,-226,-229,161,161,-231,-230,]),'OFFSETOF':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,165,-340,-27,-28,-185,-338,165,165,165,-340,165,-287,-288,-289,-286,165,165,165,165,-290,-291,165,-340,-28,165,-186,-339,165,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,165,165,165,165,-340,165,-340,-28,-73,-69,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,-287,165,165,-340,165,165,-221,-220,165,165,-237,165,165,165,165,165,-87,-74,165,-233,-234,-236,165,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,165,-12,165,-287,165,165,165,-340,165,165,165,-222,165,-224,165,-86,-75,165,-232,-235,-340,-201,-340,-68,165,165,165,-340,-28,-287,-223,165,165,165,165,165,165,-11,-287,165,165,-225,-87,-74,-227,-228,165,-340,165,165,165,-226,-229,165,165,-231,-230,]),'INT_CONST_DEC':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,166,-340,-27,-28,-185,-338,166,166,166,-340,166,-287,-288,-289,-286,166,166,166,166,-290,-291,166,-340,-28,166,-186,-339,166,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,166,166,166,166,-340,166,-340,-28,-73,-69,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,-287,166,166,-340,166,166,-221,-220,166,166,-237,166,166,166,166,166,-87,-74,166,-233,-234,-236,166,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,166,-12,166,-287,166,166,166,-340,166,166,166,-222,166,-224,166,-86,-75,166,-232,-235,-340,-201,-340,-68,166,166,166,-340,-28,-287,-223,166,166,166,166,166,166,-11,-287,166,166,-225,-87,-74,-227,-228,166,-340,166,166,166,-226,-229,166,166,-231,-230,]),'INT_CONST_OCT':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,167,-340,-27,-28,-185,-338,167,167,167,-340,167,-287,-288,-289,-286,167,167,167,167,-290,-291,167,-340,-28,167,-186,-339,167,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,167,167,167,167,-340,167,-340,-28,-73,-69,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,-287,167,167,-340,167,167,-221,-220,167,167,-237,167,167,167,167,167,-87,-74,167,-233,-234,-236,167,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,167,-12,167,-287,167,167,167,-340,167,167,167,-222,167,-224,167,-86,-75,167,-232,-235,-340,-201,-340,-68,167,167,167,-340,-28,-287,-223,167,167,167,167,167,167,-11,-287,167,167,-225,-87,-74,-227,-228,167,-340,167,167,167,-226,-229,167,167,-231,-230,]),'INT_CONST_HEX':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,168,-340,-27,-28,-185,-338,168,168,168,-340,168,-287,-288,-289,-286,168,168,168,168,-290,-291,168,-340,-28,168,-186,-339,168,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,168,168,168,168,-340,168,-340,-28,-73,-69,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,-287,168,168,-340,168,168,-221,-220,168,168,-237,168,168,168,168,168,-87,-74,168,-233,-234,-236,168,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,168,-12,168,-287,168,168,168,-340,168,168,168,-222,168,-224,168,-86,-75,168,-232,-235,-340,-201,-340,-68,168,168,168,-340,-28,-287,-223,168,168,168,168,168,168,-11,-287,168,168,-225,-87,-74,-227,-228,168,-340,168,168,168,-226,-229,168,168,-231,-230,]),'INT_CONST_BIN':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,169,-340,-27,-28,-185,-338,169,169,169,-340,169,-287,-288,-289,-286,169,169,169,169,-290,-291,169,-340,-28,169,-186,-339,169,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,169,169,169,169,-340,169,-340,-28,-73,-69,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,-287,169,169,-340,169,169,-221,-220,169,169,-237,169,169,169,169,169,-87,-74,169,-233,-234,-236,169,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,169,-12,169,-287,169,169,169,-340,169,169,169,-222,169,-224,169,-86,-75,169,-232,-235,-340,-201,-340,-68,169,169,169,-340,-28,-287,-223,169,169,169,169,169,169,-11,-287,169,169,-225,-87,-74,-227,-228,169,-340,169,169,169,-226,-229,169,169,-231,-230,]),'INT_CONST_CHAR':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,170,-340,-27,-28,-185,-338,170,170,170,-340,170,-287,-288,-289,-286,170,170,170,170,-290,-291,170,-340,-28,170,-186,-339,170,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,170,170,170,170,-340,170,-340,-28,-73,-69,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,-287,170,170,-340,170,170,-221,-220,170,170,-237,170,170,170,170,170,-87,-74,170,-233,-234,-236,170,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,170,-12,170,-287,170,170,170,-340,170,170,170,-222,170,-224,170,-86,-75,170,-232,-235,-340,-201,-340,-68,170,170,170,-340,-28,-287,-223,170,170,170,170,170,170,-11,-287,170,170,-225,-87,-74,-227,-228,170,-340,170,170,170,-226,-229,170,170,-231,-230,]),'FLOAT_CONST':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,171,-340,-27,-28,-185,-338,171,171,171,-340,171,-287,-288,-289,-286,171,171,171,171,-290,-291,171,-340,-28,171,-186,-339,171,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,171,171,171,171,-340,171,-340,-28,-73,-69,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,-287,171,171,-340,171,171,-221,-220,171,171,-237,171,171,171,171,171,-87,-74,171,-233,-234,-236,171,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,171,-12,171,-287,171,171,171,-340,171,171,171,-222,171,-224,171,-86,-75,171,-232,-235,-340,-201,-340,-68,171,171,171,-340,-28,-287,-223,171,171,171,171,171,171,-11,-287,171,171,-225,-87,-74,-227,-228,171,-340,171,171,171,-226,-229,171,171,-231,-230,]),'HEX_FLOAT_CONST':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,172,-340,-27,-28,-185,-338,172,172,172,-340,172,-287,-288,-289,-286,172,172,172,172,-290,-291,172,-340,-28,172,-186,-339,172,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,172,172,172,172,-340,172,-340,-28,-73,-69,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,-287,172,172,-340,172,172,-221,-220,172,172,-237,172,172,172,172,172,-87,-74,172,-233,-234,-236,172,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,172,-12,172,-287,172,172,172,-340,172,172,172,-222,172,-224,172,-86,-75,172,-232,-235,-340,-201,-340,-68,172,172,172,-340,-28,-287,-223,172,172,172,172,172,172,-11,-287,172,172,-225,-87,-74,-227,-228,172,-340,172,172,172,-226,-229,172,172,-231,-230,]),'CHAR_CONST':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,173,-340,-27,-28,-185,-338,173,173,173,-340,173,-287,-288,-289,-286,173,173,173,173,-290,-291,173,-340,-28,173,-186,-339,173,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,173,173,173,173,-340,173,-340,-28,-73,-69,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,-287,173,173,-340,173,173,-221,-220,173,173,-237,173,173,173,173,173,-87,-74,173,-233,-234,-236,173,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,173,-12,173,-287,173,173,173,-340,173,173,173,-222,173,-224,173,-86,-75,173,-232,-235,-340,-201,-340,-68,173,173,173,-340,-28,-287,-223,173,173,173,173,173,173,-11,-287,173,173,-225,-87,-74,-227,-228,173,-340,173,173,173,-226,-229,173,173,-231,-230,]),'WCHAR_CONST':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,174,-340,-27,-28,-185,-338,174,174,174,-340,174,-287,-288,-289,-286,174,174,174,174,-290,-291,174,-340,-28,174,-186,-339,174,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,174,174,174,174,-340,174,-340,-28,-73,-69,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,-287,174,174,-340,174,174,-221,-220,174,174,-237,174,174,174,174,174,-87,-74,174,-233,-234,-236,174,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,174,-12,174,-287,174,174,174,-340,174,174,174,-222,174,-224,174,-86,-75,174,-232,-235,-340,-201,-340,-68,174,174,174,-340,-28,-287,-223,174,174,174,174,174,174,-11,-287,174,174,-225,-87,-74,-227,-228,174,-340,174,174,174,-226,-229,174,174,-231,-230,]),'U8CHAR_CONST':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,175,-340,-27,-28,-185,-338,175,175,175,-340,175,-287,-288,-289,-286,175,175,175,175,-290,-291,175,-340,-28,175,-186,-339,175,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,175,175,175,175,-340,175,-340,-28,-73,-69,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,-287,175,175,-340,175,175,-221,-220,175,175,-237,175,175,175,175,175,-87,-74,175,-233,-234,-236,175,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,175,-12,175,-287,175,175,175,-340,175,175,175,-222,175,-224,175,-86,-75,175,-232,-235,-340,-201,-340,-68,175,175,175,-340,-28,-287,-223,175,175,175,175,175,175,-11,-287,175,175,-225,-87,-74,-227,-228,175,-340,175,175,175,-226,-229,175,175,-231,-230,]),'U16CHAR_CONST':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,176,-340,-27,-28,-185,-338,176,176,176,-340,176,-287,-288,-289,-286,176,176,176,176,-290,-291,176,-340,-28,176,-186,-339,176,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,176,176,176,176,-340,176,-340,-28,-73,-69,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,-287,176,176,-340,176,176,-221,-220,176,176,-237,176,176,176,176,176,-87,-74,176,-233,-234,-236,176,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,176,-12,176,-287,176,176,176,-340,176,176,176,-222,176,-224,176,-86,-75,176,-232,-235,-340,-201,-340,-68,176,176,176,-340,-28,-287,-223,176,176,176,176,176,176,-11,-287,176,176,-225,-87,-74,-227,-228,176,-340,176,176,176,-226,-229,176,176,-231,-230,]),'U32CHAR_CONST':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,177,-340,-27,-28,-185,-338,177,177,177,-340,177,-287,-288,-289,-286,177,177,177,177,-290,-291,177,-340,-28,177,-186,-339,177,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,177,177,177,177,-340,177,-340,-28,-73,-69,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,-287,177,177,-340,177,177,-221,-220,177,177,-237,177,177,177,177,177,-87,-74,177,-233,-234,-236,177,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,177,-12,177,-287,177,177,177,-340,177,177,177,-222,177,-224,177,-86,-75,177,-232,-235,-340,-201,-340,-68,177,177,177,-340,-28,-287,-223,177,177,177,177,177,177,-11,-287,177,177,-225,-87,-74,-227,-228,177,-340,177,177,177,-226,-229,177,177,-231,-230,]),'STRING_LITERAL':([15,51,52,53,81,90,91,92,94,95,114,115,116,121,126,128,135,136,138,139,141,143,147,148,149,150,153,154,155,156,160,161,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,263,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,407,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,139,139,-340,-27,-28,-185,-338,139,139,139,-340,263,-328,139,263,-287,-288,-289,-286,139,139,139,139,-290,-291,139,-340,-28,139,-186,-339,139,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,139,139,139,139,-340,139,-340,-28,-73,-329,139,-69,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,-287,139,139,-340,139,139,-221,-220,139,139,-237,139,139,139,139,139,-87,-74,139,-233,-234,-236,139,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,139,-12,139,-287,139,139,139,263,-340,139,139,139,-222,139,-224,139,-86,-75,139,-232,-235,-340,-201,-340,-68,139,139,139,-340,-28,-287,-223,139,139,139,139,139,139,-11,-287,139,139,-225,-87,-74,-227,-228,139,-340,139,139,139,-226,-229,139,139,-231,-230,]),'WSTRING_LITERAL':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,164,178,179,180,181,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,300,301,302,303,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,178,-340,-27,-28,-185,-338,178,178,178,-340,178,-287,-288,-289,-286,178,178,178,178,-290,-291,300,-330,-331,-332,-333,178,-340,-28,178,-186,-339,178,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,178,178,178,178,-340,178,-340,-28,-73,-69,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,-334,-335,-336,-337,-287,178,178,-340,178,178,-221,-220,178,178,-237,178,178,178,178,178,-87,-74,178,-233,-234,-236,178,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,178,-12,178,-287,178,178,178,-340,178,178,178,-222,178,-224,178,-86,-75,178,-232,-235,-340,-201,-340,-68,178,178,178,-340,-28,-287,-223,178,178,178,178,178,178,-11,-287,178,178,-225,-87,-74,-227,-228,178,-340,178,178,178,-226,-229,178,178,-231,-230,]),'U8STRING_LITERAL':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,164,178,179,180,181,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,300,301,302,303,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,179,-340,-27,-28,-185,-338,179,179,179,-340,179,-287,-288,-289,-286,179,179,179,179,-290,-291,301,-330,-331,-332,-333,179,-340,-28,179,-186,-339,179,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,179,179,179,179,-340,179,-340,-28,-73,-69,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,-334,-335,-336,-337,-287,179,179,-340,179,179,-221,-220,179,179,-237,179,179,179,179,179,-87,-74,179,-233,-234,-236,179,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,179,-12,179,-287,179,179,179,-340,179,179,179,-222,179,-224,179,-86,-75,179,-232,-235,-340,-201,-340,-68,179,179,179,-340,-28,-287,-223,179,179,179,179,179,179,-11,-287,179,179,-225,-87,-74,-227,-228,179,-340,179,179,179,-226,-229,179,179,-231,-230,]),'U16STRING_LITERAL':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,164,178,179,180,181,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,300,301,302,303,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,180,-340,-27,-28,-185,-338,180,180,180,-340,180,-287,-288,-289,-286,180,180,180,180,-290,-291,302,-330,-331,-332,-333,180,-340,-28,180,-186,-339,180,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,180,180,180,180,-340,180,-340,-28,-73,-69,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,-334,-335,-336,-337,-287,180,180,-340,180,180,-221,-220,180,180,-237,180,180,180,180,180,-87,-74,180,-233,-234,-236,180,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,180,-12,180,-287,180,180,180,-340,180,180,180,-222,180,-224,180,-86,-75,180,-232,-235,-340,-201,-340,-68,180,180,180,-340,-28,-287,-223,180,180,180,180,180,180,-11,-287,180,180,-225,-87,-74,-227,-228,180,-340,180,180,180,-226,-229,180,180,-231,-230,]),'U32STRING_LITERAL':([15,51,52,53,81,90,91,94,95,114,115,116,121,126,128,135,136,141,147,148,149,150,153,154,155,156,160,161,164,178,179,180,181,182,183,184,195,197,208,221,222,223,224,225,226,227,228,229,230,231,232,234,238,242,247,256,257,258,259,262,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,300,301,302,303,306,309,310,323,332,347,355,356,358,360,361,362,365,366,367,369,370,371,372,374,375,377,378,379,380,381,382,383,384,385,386,387,388,389,392,393,394,397,400,401,402,405,448,455,457,467,469,470,471,474,479,480,482,483,484,487,489,498,499,500,503,510,511,512,520,524,525,526,527,528,529,532,533,543,544,545,552,553,554,555,556,559,562,565,570,572,579,580,582,584,585,586,],[-71,-131,-132,-133,-134,-90,-72,181,-340,-27,-28,-185,-338,181,181,181,-340,181,-287,-288,-289,-286,181,181,181,181,-290,-291,303,-330,-331,-332,-333,181,-340,-28,181,-186,-339,181,-219,-217,-218,-78,-79,-80,-81,-82,-83,-84,-85,181,181,181,181,-340,181,-340,-28,-73,-69,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,-334,-335,-336,-337,-287,181,181,-340,181,181,-221,-220,181,181,-237,181,181,181,181,181,-87,-74,181,-233,-234,-236,181,-244,-245,-246,-247,-248,-249,-250,-251,-252,-253,-254,-11,181,-12,181,-287,181,181,181,-340,181,181,181,-222,181,-224,181,-86,-75,181,-232,-235,-340,-201,-340,-68,181,181,181,-340,-28,-287,-223,181,181,181,181,181,181,-11,-287,181,181,-225,-87,-74,-227,-228,181,-340,181,181,181,-226,-229,181,181,-231,-230,]),'ELSE':([15,91,208,225,226,227,228,229,230,232,262,267,355,361,370,371,374,375,377,469,471,479,480,483,484,499,524,552,553,554,555,556,579,580,585,586,],[-71,-72,-339,-78,-79,-80,-81,-82,-83,-85,-73,-69,-221,-237,-87,-84,-233,-234,-236,-222,-224,-86,-84,-232,-235,-68,-223,-225,570,-84,-227,-228,-226,-229,-231,-230,]),'PPPRAGMASTR':([15,],[91,]),'EQUALS':([19,28,73,86,87,88,89,97,111,130,132,139,140,143,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,202,208,233,250,252,263,291,292,293,295,296,297,300,301,302,303,311,312,395,396,403,404,406,429,431,432,433,434,439,440,490,492,493,494,497,501,502,505,506,508,509,534,535,536,561,563,574,],[-52,-29,-181,135,-182,-54,-37,-53,195,-181,-55,-328,-30,-306,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,332,-339,-315,379,-38,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-35,-36,489,-202,-43,-44,-308,-295,-296,-297,-298,-299,-31,-34,-203,-205,-39,-42,-278,-293,-294,-284,-285,-32,-33,-204,-40,-41,-302,-309,-303,]),'COMMA':([19,24,25,28,29,30,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,60,73,74,75,76,77,78,81,84,85,86,87,88,89,97,104,106,108,110,111,113,114,115,116,118,119,122,123,130,132,139,140,142,143,144,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,187,189,190,191,192,196,197,200,201,202,206,208,212,214,216,233,239,248,249,250,252,253,254,255,263,265,291,292,293,295,296,297,300,301,302,303,311,312,315,316,317,318,319,320,321,324,325,326,327,328,329,330,331,334,336,337,340,341,342,344,345,346,348,349,350,352,353,354,376,391,403,404,406,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,438,439,440,444,445,446,447,459,460,461,462,463,464,468,472,473,475,476,477,485,486,488,493,494,497,501,502,505,506,508,509,515,516,518,522,523,531,535,536,537,538,539,546,547,548,549,550,551,557,560,561,563,566,567,574,576,577,578,],[-52,-128,-102,-29,-107,-340,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-181,-98,-99,-100,-101,-104,-134,134,-135,-137,-182,-54,-37,-53,-103,-129,194,-139,-141,-183,-27,-28,-185,-169,-170,-149,-150,-181,-55,-328,-30,266,-306,-255,-256,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,313,314,-189,-194,-340,-184,-186,331,-174,-179,-152,-339,-145,-147,-340,-315,365,-238,-242,-277,-38,-136,-138,-196,-329,365,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-35,-36,-191,-192,-193,-207,-56,-1,-2,-45,-209,-140,-142,331,331,-171,-175,-154,-156,-151,-143,-144,-148,466,-164,-166,-146,-130,-206,-207,-177,-178,365,487,-43,-44,-308,365,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-274,-275,-276,365,503,-295,-313,-296,-297,-298,-299,507,-31,-34,-190,-195,-57,-208,-172,-173,-176,-180,-153,-155,-168,365,-240,-239,365,365,-243,-197,-199,-39,-42,-278,-293,-294,-284,-285,-32,-33,-210,-216,-214,-165,-167,-198,-40,-41,562,-257,-314,-50,-51,-212,-211,-213,-215,365,-200,-302,-309,-46,-49,-303,365,-47,-48,]),'RPAREN':([19,24,25,28,29,30,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,60,74,75,76,77,78,81,88,89,93,96,97,104,106,113,114,115,116,118,119,122,123,132,133,137,138,139,140,142,143,144,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,185,186,187,188,189,190,191,192,196,197,206,208,212,214,215,216,217,218,239,248,249,250,252,260,261,263,264,265,288,291,292,293,295,296,297,300,301,302,303,311,312,315,316,317,318,319,320,321,322,324,325,330,334,336,337,340,341,342,348,349,350,351,352,353,354,355,357,363,364,403,404,406,407,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,428,429,430,431,432,433,434,435,436,437,439,440,443,444,445,446,447,449,450,451,452,453,454,458,459,460,463,464,472,473,475,476,477,485,493,494,497,501,502,505,506,508,509,513,514,515,516,518,521,535,536,538,539,540,541,546,547,548,549,550,551,557,559,561,563,566,567,572,573,574,575,577,578,581,583,],[-52,-128,-102,-29,-107,-340,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-98,-99,-100,-101,-104,-134,-54,-37,140,-340,-53,-103,-129,-183,-27,-28,-185,-169,-170,-149,-150,-55,252,-340,262,-328,-30,267,-306,-255,-256,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,311,312,-187,-17,-18,-189,-194,-340,-184,-186,-152,-339,-145,-147,349,-340,353,354,-14,-238,-242,-277,-38,403,404,-329,405,406,429,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-35,-36,-191,-192,-193,-207,-56,-1,-2,-340,-45,-209,-171,-154,-156,-151,-143,-144,-148,-146,-130,-206,-340,-207,-177,-178,-221,-13,473,474,-43,-44,-308,499,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-274,-275,-276,502,-295,-313,-296,-297,-298,-299,504,505,506,-31,-34,-188,-190,-195,-57,-208,-340,515,516,-207,-23,-24,-340,-172,-173,-153,-155,525,-240,-239,526,527,-243,-39,-42,-278,-293,-294,-284,-285,-32,-33,546,547,-210,-216,-214,551,-40,-41,-257,-314,563,-310,-50,-51,-212,-211,-213,-215,571,-340,-302,-309,-46,-49,-340,582,-303,-311,-47,-48,584,-312,]),'COLON':([19,24,28,31,32,33,35,38,39,40,41,42,43,44,45,46,47,48,49,51,52,53,81,87,88,89,97,106,118,119,122,123,130,132,139,140,143,144,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,206,208,209,212,214,233,235,248,249,250,252,263,291,292,293,295,296,297,300,301,302,303,311,312,330,334,336,337,340,341,342,346,348,349,353,354,359,403,404,406,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,439,440,459,460,463,464,466,473,475,485,493,494,497,501,502,505,506,508,509,535,536,538,561,563,574,],[-52,-128,-29,-125,-126,-127,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-131,-132,-133,-134,-182,-54,-37,-53,-129,-169,-170,-149,-150,-181,-55,-328,-30,-306,-255,-256,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-152,-339,347,-145,-147,358,360,-238,-242,-277,-38,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-35,-36,-171,-154,-156,-151,-143,-144,-148,467,-146,-130,-177,-178,470,-43,-44,-308,500,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-274,-275,-276,-295,-296,-297,-298,-299,-31,-34,-172,-173,-153,-155,347,-240,-239,-243,-39,-42,-278,-293,-294,-284,-285,-32,-33,-40,-41,-257,-302,-309,-303,]),'LBRACKET':([19,24,25,28,29,30,31,32,33,34,35,38,39,40,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,60,74,75,76,77,78,81,88,89,97,104,106,113,114,115,116,118,119,121,122,123,132,139,140,143,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,192,196,197,206,208,212,214,216,233,252,256,263,291,292,300,301,302,303,311,312,318,319,322,324,325,330,334,336,337,340,341,342,348,349,351,352,353,354,395,396,403,404,406,429,431,432,433,434,439,440,446,447,452,459,460,463,464,487,490,492,493,494,498,501,502,508,509,515,516,518,534,535,536,540,541,546,547,548,549,550,551,561,562,563,566,567,574,575,577,578,583,],[95,-128,-102,-29,-107,-340,-125,-126,-127,-129,-241,-113,-114,-115,-116,-117,-118,-119,-120,-121,-122,-123,-124,-131,-132,-133,-105,-106,-108,-109,-110,-111,-112,-98,-99,-100,-101,-104,-134,136,-37,95,-103,-129,-183,-27,-28,-185,-169,-170,-338,-149,-150,136,-328,-30,-306,287,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,323,-184,-186,-152,-339,-145,-147,323,-315,-38,397,-329,-300,-301,-334,-335,-336,-337,-35,-36,323,448,323,-45,457,-171,-154,-156,-151,-143,-144,-148,-146,-130,323,323,-177,-178,397,-202,-43,-44,-308,-295,-296,-297,-298,-299,-31,-34,448,457,323,-172,-173,-153,-155,397,-203,-205,-39,-42,397,-293,-294,-32,-33,-210,-216,-214,-204,-40,-41,565,-310,-50,-51,-212,-211,-213,-215,-302,397,-309,-46,-49,-303,-311,-47,-48,-312,]),'RBRACKET':([51,52,53,81,95,114,115,116,136,139,143,144,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,184,197,208,248,249,250,257,259,263,291,292,293,295,296,297,300,301,302,303,305,306,307,308,323,399,400,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,429,431,432,433,434,441,442,448,455,456,457,473,475,485,491,495,496,497,501,502,505,506,510,512,517,519,520,538,542,543,561,563,568,569,574,576,],[-131,-132,-133,-134,-340,-27,-28,-185,-340,-328,-306,-255,-256,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-340,-28,-186,-339,-238,-242,-277,-340,-28,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,439,440,-3,-4,-340,493,494,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-274,-275,-276,501,-295,-296,-297,-298,-299,508,509,-340,-340,518,-340,-240,-239,-243,534,535,536,-278,-293,-294,-284,-285,-340,-28,548,549,550,-257,566,567,-302,-309,577,578,-303,583,]),'PERIOD':([121,139,143,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,256,263,291,292,300,301,302,303,395,396,406,429,431,432,433,434,487,490,492,498,501,502,534,540,541,561,562,563,574,575,583,],[-338,-328,-306,289,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,398,-329,-300,-301,-334,-335,-336,-337,398,-202,-308,-295,-296,-297,-298,-299,398,-203,-205,398,-293,-294,-204,564,-310,-302,398,-309,-303,-311,-312,]),'ARROW':([139,143,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,263,291,292,300,301,302,303,406,429,431,432,433,434,501,502,561,563,574,],[-328,-306,290,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-329,-300,-301,-334,-335,-336,-337,-308,-295,-296,-297,-298,-299,-293,-294,-302,-309,-303,]),'CONDOP':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,268,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-274,-275,-276,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'DIVIDE':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,270,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'MOD':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,271,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'RSHIFT':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,274,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,274,274,274,274,274,274,274,274,274,274,274,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'LSHIFT':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,275,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,275,275,275,275,275,275,275,275,275,275,275,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'LT':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,276,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,276,276,276,276,276,276,276,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'LE':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,277,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,277,277,277,277,277,277,277,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'GE':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,278,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,278,278,278,278,278,278,278,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'GT':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,279,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,279,279,279,279,279,279,279,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'EQ':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,280,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,280,280,280,280,280,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'NE':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,281,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,281,281,281,281,281,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'OR':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,283,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-274,283,283,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'XOR':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,284,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,284,-274,284,284,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'LAND':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,285,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-274,-275,285,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'LOR':([139,143,145,146,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,286,-258,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,-277,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-259,-260,-261,-262,-263,-264,-265,-266,-267,-268,-269,-270,-271,-272,-273,-274,-275,-276,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'XOREQUAL':([139,143,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,380,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'TIMESEQUAL':([139,143,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,381,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'DIVEQUAL':([139,143,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,382,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'MODEQUAL':([139,143,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,383,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'PLUSEQUAL':([139,143,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,384,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'MINUSEQUAL':([139,143,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,385,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'LSHIFTEQUAL':([139,143,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,386,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'RSHIFTEQUAL':([139,143,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,387,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'ANDEQUAL':([139,143,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,388,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'OREQUAL':([139,143,151,152,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,208,233,250,263,291,292,293,295,296,297,300,301,302,303,406,429,431,432,433,434,497,501,502,505,506,561,563,574,],[-328,-306,-277,-279,-292,-315,-304,-305,-307,-316,-317,-318,-319,-320,-321,-322,-323,-324,-325,-326,-327,-330,-331,-332,-333,-339,-315,389,-329,-300,-301,-280,-281,-282,-283,-334,-335,-336,-337,-308,-295,-296,-297,-298,-299,-278,-293,-294,-284,-285,-302,-309,-303,]),'ELLIPSIS':([313,],[443,]),} _lr_action = {} for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items _lr_goto_items = {'translation_unit_or_empty':([0,],[1,]),'translation_unit':([0,],[2,]),'empty':([0,11,12,21,22,23,26,27,30,34,69,70,71,73,95,96,101,128,136,137,182,183,192,209,216,221,242,256,257,258,322,323,351,358,360,369,372,448,449,455,457,458,470,482,487,498,510,511,525,526,527,529,559,562,570,572,582,584,],[3,66,83,99,99,99,107,99,114,99,83,107,99,66,114,188,99,220,114,188,307,114,320,343,320,357,357,392,307,114,453,114,453,357,357,357,357,114,188,307,307,453,357,357,533,533,307,114,357,357,357,357,357,533,357,357,357,357,]),'external_declaration':([0,2,],[4,64,]),'function_definition':([0,2,],[5,5,]),'declaration':([0,2,11,67,73,128,221,372,],[6,6,68,129,68,223,223,482,]),'pp_directive':([0,2,],[7,7,]),'pppragma_directive':([0,2,124,128,203,204,205,221,242,333,335,358,360,369,470,525,526,527,570,582,584,],[8,8,211,231,211,211,211,231,371,211,211,371,371,480,371,554,371,371,371,371,371,]),'static_assert':([0,2,128,221,242,358,360,369,470,525,526,527,570,582,584,],[10,10,232,232,232,232,232,232,232,232,232,232,232,232,232,]),'id_declarator':([0,2,12,17,26,69,70,82,134,192,194,209,322,466,],[11,11,73,93,111,130,111,93,130,315,130,130,93,130,]),'declaration_specifiers':([0,2,11,67,73,96,128,137,221,313,322,351,372,449,458,],[12,12,69,69,69,192,69,192,69,192,192,192,69,192,192,]),'decl_body':([0,2,11,67,73,128,221,372,],[13,13,13,13,13,13,13,13,]),'direct_id_declarator':([0,2,12,17,20,26,69,70,80,82,134,192,194,209,318,322,452,466,],[19,19,19,19,97,19,19,19,97,19,19,19,19,19,97,19,97,19,]),'pointer':([0,2,12,17,26,69,70,82,113,134,192,194,209,216,322,351,466,],[20,20,80,20,20,80,20,80,196,80,318,80,80,352,452,352,80,]),'type_qualifier':([0,2,11,12,21,22,23,27,30,34,67,69,71,73,95,96,101,115,124,125,126,128,136,137,141,183,184,192,203,204,205,209,213,216,221,238,258,259,294,298,299,304,313,322,323,333,335,351,372,448,449,458,511,512,],[21,21,21,74,21,21,21,21,116,21,21,74,21,21,116,21,21,197,116,116,116,21,116,21,116,116,197,74,116,116,116,341,197,341,21,116,116,197,116,116,116,116,21,21,116,116,116,21,21,116,21,21,116,197,]),'storage_class_specifier':([0,2,11,12,21,22,23,27,34,67,69,71,73,96,101,128,137,192,221,313,322,351,372,449,458,],[22,22,22,75,22,22,22,22,22,22,75,22,22,22,22,22,22,75,22,22,22,22,22,22,22,]),'function_specifier':([0,2,11,12,21,22,23,27,34,67,69,71,73,96,101,128,137,192,221,313,322,351,372,449,458,],[23,23,23,76,23,23,23,23,23,23,76,23,23,23,23,23,23,76,23,23,23,23,23,23,23,]),'type_specifier_no_typeid':([0,2,11,12,26,67,69,70,73,96,124,125,126,128,137,141,192,193,203,204,205,209,213,216,221,238,294,298,299,304,313,322,333,335,351,372,449,458,],[24,24,24,77,24,24,77,24,24,24,24,24,24,24,24,24,77,24,24,24,24,340,24,340,24,24,24,24,24,24,24,24,24,24,24,24,24,24,]),'type_specifier':([0,2,11,26,67,70,73,96,124,125,126,128,137,141,193,203,204,205,213,221,238,294,298,299,304,313,322,333,335,351,372,449,458,],[25,25,25,104,25,104,25,25,212,212,212,25,25,212,104,212,212,212,348,25,212,212,212,212,212,25,25,212,212,25,25,25,25,]),'declaration_specifiers_no_type':([0,2,11,21,22,23,27,34,67,71,73,96,101,128,137,221,313,322,351,372,449,458,],[26,26,70,100,100,100,100,100,70,100,70,193,100,70,193,70,193,193,193,70,193,193,]),'alignment_specifier':([0,2,11,12,21,22,23,27,34,67,69,71,73,96,101,124,125,126,128,137,141,192,203,204,205,209,216,221,238,294,298,299,304,313,322,333,335,351,372,449,458,],[27,27,27,78,27,27,27,27,27,27,78,27,27,27,27,214,214,214,27,27,214,78,214,214,214,342,342,27,214,214,214,214,214,27,27,214,214,27,27,27,27,]),'typedef_name':([0,2,11,26,67,70,73,96,124,125,126,128,137,141,193,203,204,205,213,221,238,294,298,299,304,313,322,333,335,351,372,449,458,],[31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,]),'enum_specifier':([0,2,11,26,67,70,73,96,124,125,126,128,137,141,193,203,204,205,213,221,238,294,298,299,304,313,322,333,335,351,372,449,458,],[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,]),'struct_or_union_specifier':([0,2,11,26,67,70,73,96,124,125,126,128,137,141,193,203,204,205,213,221,238,294,298,299,304,313,322,333,335,351,372,449,458,],[33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,]),'atomic_specifier':([0,2,11,21,22,23,26,27,34,67,70,71,73,96,101,124,125,126,128,137,141,193,203,204,205,213,221,238,294,298,299,304,313,322,333,335,351,372,449,458,],[34,34,71,101,101,101,106,101,101,71,106,101,71,34,101,106,106,106,71,34,106,106,106,106,106,106,71,106,106,106,106,106,34,34,106,106,34,71,34,34,]),'struct_or_union':([0,2,11,26,67,70,73,96,124,125,126,128,137,141,193,203,204,205,213,221,238,294,298,299,304,313,322,333,335,351,372,449,458,],[37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,]),'declaration_list_opt':([11,73,],[65,131,]),'declaration_list':([11,73,],[67,67,]),'init_declarator_list_opt':([12,69,],[79,79,]),'init_declarator_list':([12,69,],[84,84,]),'init_declarator':([12,69,134,194,],[85,85,253,326,]),'declarator':([12,69,134,194,209,466,],[86,86,86,86,346,346,]),'typeid_declarator':([12,69,82,134,194,209,466,],[87,87,133,87,87,87,87,]),'direct_typeid_declarator':([12,69,80,82,134,194,209,466,],[88,88,132,88,88,88,88,88,]),'declaration_specifiers_no_type_opt':([21,22,23,27,34,71,101,],[98,102,103,112,117,117,117,]),'id_init_declarator_list_opt':([26,70,],[105,105,]),'id_init_declarator_list':([26,70,],[108,108,]),'id_init_declarator':([26,70,],[110,110,]),'type_qualifier_list_opt':([30,95,136,183,258,323,448,511,],[113,182,257,309,401,455,510,544,]),'type_qualifier_list':([30,95,124,125,126,136,141,183,203,204,205,238,258,294,298,299,304,323,333,335,448,511,],[115,184,213,213,213,259,213,115,213,213,213,213,115,213,213,213,213,115,213,213,512,115,]),'brace_open':([36,37,65,118,119,122,123,128,131,135,195,221,238,242,358,360,369,393,405,470,474,504,505,525,526,527,532,570,582,584,],[120,124,128,198,199,203,204,128,128,256,256,128,128,128,128,128,128,256,498,128,498,498,498,128,128,128,256,128,128,128,]),'compound_statement':([65,128,131,221,238,242,358,360,369,470,525,526,527,570,582,584,],[127,227,251,227,363,227,227,227,227,227,227,227,227,227,227,227,]),'unified_string_literal':([92,94,126,128,135,141,153,154,155,156,182,195,221,234,238,242,247,257,266,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,309,310,332,347,358,360,362,365,366,367,369,372,378,393,397,401,402,405,455,457,467,470,474,482,500,503,510,525,526,527,528,529,532,544,545,559,565,570,572,582,584,],[138,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,407,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,]),'constant_expression':([94,126,234,332,347,397,467,],[142,218,359,462,468,491,523,]),'conditional_expression':([94,126,128,135,141,182,195,221,234,238,242,247,257,268,287,288,294,298,309,310,332,347,358,360,362,365,366,367,369,372,378,393,397,401,402,455,457,467,470,482,500,503,510,525,526,527,528,529,532,544,545,559,565,570,572,582,584,],[144,144,249,249,249,249,249,249,144,249,249,249,249,249,249,249,249,249,249,249,144,144,249,249,249,249,249,249,249,249,249,249,144,249,249,249,249,144,249,249,538,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,]),'binary_expression':([94,126,128,135,141,182,195,221,234,238,242,247,257,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,309,310,332,347,358,360,362,365,366,367,369,372,378,393,397,401,402,455,457,467,470,482,500,503,510,525,526,527,528,529,532,544,545,559,565,570,572,582,584,],[145,145,145,145,145,145,145,145,145,145,145,145,145,145,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,]),'cast_expression':([94,126,128,135,141,155,182,195,221,234,238,242,247,257,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,309,310,332,347,358,360,362,365,366,367,369,372,378,393,397,401,402,405,455,457,467,470,474,482,500,503,510,525,526,527,528,529,532,544,545,559,565,570,572,582,584,],[146,146,146,146,146,296,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,497,146,146,146,146,497,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,]),'unary_expression':([94,126,128,135,141,153,154,155,156,182,195,221,234,238,242,247,257,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,309,310,332,347,358,360,362,365,366,367,369,372,378,393,397,401,402,405,455,457,467,470,474,482,500,503,510,525,526,527,528,529,532,544,545,559,565,570,572,582,584,],[151,151,250,250,250,293,295,151,297,250,250,250,151,250,250,250,250,250,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,250,250,250,250,250,250,151,151,250,250,250,250,250,250,250,250,250,250,151,250,250,151,250,250,151,250,151,250,151,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,]),'postfix_expression':([94,126,128,135,141,153,154,155,156,182,195,221,234,238,242,247,257,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,309,310,332,347,358,360,362,365,366,367,369,372,378,393,397,401,402,405,455,457,467,470,474,482,500,503,510,525,526,527,528,529,532,544,545,559,565,570,572,582,584,],[152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,]),'unary_operator':([94,126,128,135,141,153,154,155,156,182,195,221,234,238,242,247,257,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,309,310,332,347,358,360,362,365,366,367,369,372,378,393,397,401,402,405,455,457,467,470,474,482,500,503,510,525,526,527,528,529,532,544,545,559,565,570,572,582,584,],[155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,]),'primary_expression':([94,126,128,135,141,153,154,155,156,182,195,221,234,238,242,247,257,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,309,310,332,347,358,360,362,365,366,367,369,372,378,393,397,401,402,405,455,457,467,470,474,482,500,503,510,525,526,527,528,529,532,544,545,559,565,570,572,582,584,],[158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,]),'identifier':([94,96,126,128,135,137,141,153,154,155,156,182,195,221,234,238,242,247,257,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,309,310,314,332,347,358,360,362,365,366,367,369,372,378,393,397,398,401,402,405,449,455,457,467,470,474,482,500,503,507,510,525,526,527,528,529,532,544,545,559,564,565,570,572,582,584,],[162,191,162,162,162,191,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,445,162,162,162,162,162,162,162,162,162,162,162,162,162,492,162,162,162,191,162,162,162,162,162,162,162,162,541,162,162,162,162,162,162,162,162,162,162,575,162,162,162,162,162,]),'constant':([94,126,128,135,141,153,154,155,156,182,195,221,234,238,242,247,257,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,309,310,332,347,358,360,362,365,366,367,369,372,378,393,397,401,402,405,455,457,467,470,474,482,500,503,510,525,526,527,528,529,532,544,545,559,565,570,572,582,584,],[163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,]),'unified_wstring_literal':([94,126,128,135,141,153,154,155,156,182,195,221,234,238,242,247,257,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294,298,309,310,332,347,358,360,362,365,366,367,369,372,378,393,397,401,402,405,455,457,467,470,474,482,500,503,510,525,526,527,528,529,532,544,545,559,565,570,572,582,584,],[164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,]),'parameter_type_list':([96,137,322,351,449,458,],[185,260,454,454,513,454,]),'identifier_list_opt':([96,137,449,],[186,261,514,]),'parameter_list':([96,137,322,351,449,458,],[187,187,187,187,187,187,]),'identifier_list':([96,137,449,],[189,189,189,]),'parameter_declaration':([96,137,313,322,351,449,458,],[190,190,444,190,190,190,190,]),'enumerator_list':([120,198,199,],[200,328,329,]),'enumerator':([120,198,199,331,],[201,201,201,461,]),'struct_declaration_list':([124,203,204,],[205,333,335,]),'brace_close':([124,200,203,204,205,219,328,329,333,335,390,487,537,562,],[206,330,334,336,337,355,459,460,463,464,486,531,561,574,]),'struct_declaration':([124,203,204,205,333,335,],[207,207,207,338,338,338,]),'specifier_qualifier_list':([124,125,126,141,203,204,205,238,294,298,299,304,333,335,],[209,216,216,216,209,209,209,216,216,216,216,216,209,209,]),'type_name':([125,126,141,238,294,298,299,304,],[215,217,264,364,435,436,437,438,]),'block_item_list_opt':([128,],[219,]),'block_item_list':([128,],[221,]),'block_item':([128,221,],[222,356,]),'statement':([128,221,242,358,360,369,470,525,526,527,570,582,584,],[224,224,370,370,370,479,370,553,370,370,370,370,370,]),'labeled_statement':([128,221,242,358,360,369,470,525,526,527,570,582,584,],[225,225,225,225,225,225,225,225,225,225,225,225,225,]),'expression_statement':([128,221,242,358,360,369,470,525,526,527,570,582,584,],[226,226,226,226,226,226,226,226,226,226,226,226,226,]),'selection_statement':([128,221,242,358,360,369,470,525,526,527,570,582,584,],[228,228,228,228,228,228,228,228,228,228,228,228,228,]),'iteration_statement':([128,221,242,358,360,369,470,525,526,527,570,582,584,],[229,229,229,229,229,229,229,229,229,229,229,229,229,]),'jump_statement':([128,221,242,358,360,369,470,525,526,527,570,582,584,],[230,230,230,230,230,230,230,230,230,230,230,230,230,]),'expression_opt':([128,221,242,358,360,369,372,470,482,525,526,527,529,559,570,572,582,584,],[236,236,236,236,236,236,481,236,530,236,236,236,558,573,236,581,236,236,]),'expression':([128,141,221,238,242,247,268,287,294,298,358,360,362,366,367,369,372,470,482,525,526,527,528,529,559,565,570,572,582,584,],[239,265,239,265,239,376,408,427,265,265,239,239,472,476,477,239,239,239,239,239,239,239,557,239,239,576,239,239,239,239,]),'assignment_expression':([128,135,141,182,195,221,238,242,247,257,268,287,288,294,298,309,310,358,360,362,365,366,367,369,372,378,393,401,402,455,457,470,482,503,510,525,526,527,528,529,532,544,545,559,565,570,572,582,584,],[248,255,248,308,255,248,248,248,248,308,248,248,430,248,248,441,442,248,248,248,475,248,248,248,248,485,255,495,496,308,308,248,248,539,308,248,248,248,248,248,255,568,569,248,248,248,248,248,248,]),'initializer':([135,195,393,532,],[254,327,488,560,]),'assignment_expression_opt':([182,257,455,457,510,],[305,399,517,519,542,]),'typeid_noparen_declarator':([192,],[316,]),'abstract_declarator_opt':([192,216,],[317,350,]),'direct_typeid_noparen_declarator':([192,318,],[319,446,]),'abstract_declarator':([192,216,322,351,],[321,321,450,450,]),'direct_abstract_declarator':([192,216,318,322,351,352,452,],[325,325,447,325,325,447,447,]),'struct_declarator_list_opt':([209,],[339,]),'struct_declarator_list':([209,],[344,]),'struct_declarator':([209,466,],[345,522,]),'pragmacomp_or_statement':([242,358,360,470,525,526,527,570,582,584,],[368,469,471,524,552,555,556,579,585,586,]),'pppragma_directive_list':([242,358,360,470,525,526,527,570,582,584,],[369,369,369,369,369,369,369,369,369,369,]),'assignment_operator':([250,],[378,]),'initializer_list_opt':([256,],[390,]),'initializer_list':([256,498,],[391,537,]),'designation_opt':([256,487,498,562,],[393,532,393,532,]),'designation':([256,487,498,562,],[394,394,394,394,]),'designator_list':([256,487,498,562,],[395,395,395,395,]),'designator':([256,395,487,498,562,],[396,490,396,396,396,]),'argument_expression_list':([288,],[428,]),'parameter_type_list_opt':([322,351,458,],[451,451,521,]),'offsetof_member_designator':([507,],[540,]),} _lr_goto = {} for _k, _v in _lr_goto_items.items(): for _x, _y in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items _lr_productions = [ ("S' -> translation_unit_or_empty","S'",1,None,None,None), ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',43), ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',44), ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',43), ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',44), ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',43), ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',44), ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',43), ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',44), ('declaration_specifiers_no_type_opt -> empty','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',43), ('declaration_specifiers_no_type_opt -> declaration_specifiers_no_type','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',44), ('designation_opt -> empty','designation_opt',1,'p_designation_opt','plyparser.py',43), ('designation_opt -> designation','designation_opt',1,'p_designation_opt','plyparser.py',44), ('expression_opt -> empty','expression_opt',1,'p_expression_opt','plyparser.py',43), ('expression_opt -> expression','expression_opt',1,'p_expression_opt','plyparser.py',44), ('id_init_declarator_list_opt -> empty','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',43), ('id_init_declarator_list_opt -> id_init_declarator_list','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',44), ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',43), ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',44), ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',43), ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',44), ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',43), ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',44), ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',43), ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',44), ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',43), ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',44), ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',43), ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',44), ('direct_id_declarator -> ID','direct_id_declarator',1,'p_direct_id_declarator_1','plyparser.py',126), ('direct_id_declarator -> LPAREN id_declarator RPAREN','direct_id_declarator',3,'p_direct_id_declarator_2','plyparser.py',126), ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_3','plyparser.py',126), ('direct_id_declarator -> direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',126), ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',127), ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_5','plyparser.py',126), ('direct_id_declarator -> direct_id_declarator LPAREN parameter_type_list RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',126), ('direct_id_declarator -> direct_id_declarator LPAREN identifier_list_opt RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',127), ('direct_typeid_declarator -> TYPEID','direct_typeid_declarator',1,'p_direct_typeid_declarator_1','plyparser.py',126), ('direct_typeid_declarator -> LPAREN typeid_declarator RPAREN','direct_typeid_declarator',3,'p_direct_typeid_declarator_2','plyparser.py',126), ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_3','plyparser.py',126), ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',126), ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',127), ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_5','plyparser.py',126), ('direct_typeid_declarator -> direct_typeid_declarator LPAREN parameter_type_list RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',126), ('direct_typeid_declarator -> direct_typeid_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',127), ('direct_typeid_noparen_declarator -> TYPEID','direct_typeid_noparen_declarator',1,'p_direct_typeid_noparen_declarator_1','plyparser.py',126), ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_3','plyparser.py',126), ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',126), ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',127), ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_5','plyparser.py',126), ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',126), ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',127), ('id_declarator -> direct_id_declarator','id_declarator',1,'p_id_declarator_1','plyparser.py',126), ('id_declarator -> pointer direct_id_declarator','id_declarator',2,'p_id_declarator_2','plyparser.py',126), ('typeid_declarator -> direct_typeid_declarator','typeid_declarator',1,'p_typeid_declarator_1','plyparser.py',126), ('typeid_declarator -> pointer direct_typeid_declarator','typeid_declarator',2,'p_typeid_declarator_2','plyparser.py',126), ('typeid_noparen_declarator -> direct_typeid_noparen_declarator','typeid_noparen_declarator',1,'p_typeid_noparen_declarator_1','plyparser.py',126), ('typeid_noparen_declarator -> pointer direct_typeid_noparen_declarator','typeid_noparen_declarator',2,'p_typeid_noparen_declarator_2','plyparser.py',126), ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',509), ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',510), ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','c_parser.py',518), ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','c_parser.py',524), ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','c_parser.py',534), ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','c_parser.py',539), ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',544), ('external_declaration -> pppragma_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',545), ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','c_parser.py',550), ('external_declaration -> static_assert','external_declaration',1,'p_external_declaration_5','c_parser.py',555), ('static_assert -> _STATIC_ASSERT LPAREN constant_expression COMMA unified_string_literal RPAREN','static_assert',6,'p_static_assert_declaration','c_parser.py',560), ('static_assert -> _STATIC_ASSERT LPAREN constant_expression RPAREN','static_assert',4,'p_static_assert_declaration','c_parser.py',561), ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','c_parser.py',569), ('pppragma_directive -> PPPRAGMA','pppragma_directive',1,'p_pppragma_directive','c_parser.py',580), ('pppragma_directive -> PPPRAGMA PPPRAGMASTR','pppragma_directive',2,'p_pppragma_directive','c_parser.py',581), ('pppragma_directive -> _PRAGMA LPAREN unified_string_literal RPAREN','pppragma_directive',4,'p_pppragma_directive','c_parser.py',582), ('pppragma_directive_list -> pppragma_directive','pppragma_directive_list',1,'p_pppragma_directive_list','c_parser.py',592), ('pppragma_directive_list -> pppragma_directive_list pppragma_directive','pppragma_directive_list',2,'p_pppragma_directive_list','c_parser.py',593), ('function_definition -> id_declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','c_parser.py',600), ('function_definition -> declaration_specifiers id_declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','c_parser.py',618), ('statement -> labeled_statement','statement',1,'p_statement','c_parser.py',633), ('statement -> expression_statement','statement',1,'p_statement','c_parser.py',634), ('statement -> compound_statement','statement',1,'p_statement','c_parser.py',635), ('statement -> selection_statement','statement',1,'p_statement','c_parser.py',636), ('statement -> iteration_statement','statement',1,'p_statement','c_parser.py',637), ('statement -> jump_statement','statement',1,'p_statement','c_parser.py',638), ('statement -> pppragma_directive','statement',1,'p_statement','c_parser.py',639), ('statement -> static_assert','statement',1,'p_statement','c_parser.py',640), ('pragmacomp_or_statement -> pppragma_directive_list statement','pragmacomp_or_statement',2,'p_pragmacomp_or_statement','c_parser.py',688), ('pragmacomp_or_statement -> statement','pragmacomp_or_statement',1,'p_pragmacomp_or_statement','c_parser.py',689), ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',708), ('decl_body -> declaration_specifiers_no_type id_init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',709), ('declaration -> decl_body SEMI','declaration',2,'p_declaration','c_parser.py',769), ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','c_parser.py',778), ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','c_parser.py',779), ('declaration_specifiers_no_type -> type_qualifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_1','c_parser.py',789), ('declaration_specifiers_no_type -> storage_class_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_2','c_parser.py',794), ('declaration_specifiers_no_type -> function_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_3','c_parser.py',799), ('declaration_specifiers_no_type -> atomic_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_4','c_parser.py',806), ('declaration_specifiers_no_type -> alignment_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_5','c_parser.py',811), ('declaration_specifiers -> declaration_specifiers type_qualifier','declaration_specifiers',2,'p_declaration_specifiers_1','c_parser.py',816), ('declaration_specifiers -> declaration_specifiers storage_class_specifier','declaration_specifiers',2,'p_declaration_specifiers_2','c_parser.py',821), ('declaration_specifiers -> declaration_specifiers function_specifier','declaration_specifiers',2,'p_declaration_specifiers_3','c_parser.py',826), ('declaration_specifiers -> declaration_specifiers type_specifier_no_typeid','declaration_specifiers',2,'p_declaration_specifiers_4','c_parser.py',831), ('declaration_specifiers -> type_specifier','declaration_specifiers',1,'p_declaration_specifiers_5','c_parser.py',836), ('declaration_specifiers -> declaration_specifiers_no_type type_specifier','declaration_specifiers',2,'p_declaration_specifiers_6','c_parser.py',841), ('declaration_specifiers -> declaration_specifiers alignment_specifier','declaration_specifiers',2,'p_declaration_specifiers_7','c_parser.py',846), ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',851), ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',852), ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',853), ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',854), ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',855), ('storage_class_specifier -> _THREAD_LOCAL','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',856), ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','c_parser.py',861), ('function_specifier -> _NORETURN','function_specifier',1,'p_function_specifier','c_parser.py',862), ('type_specifier_no_typeid -> VOID','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',867), ('type_specifier_no_typeid -> _BOOL','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',868), ('type_specifier_no_typeid -> CHAR','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',869), ('type_specifier_no_typeid -> SHORT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',870), ('type_specifier_no_typeid -> INT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',871), ('type_specifier_no_typeid -> LONG','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',872), ('type_specifier_no_typeid -> FLOAT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',873), ('type_specifier_no_typeid -> DOUBLE','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',874), ('type_specifier_no_typeid -> _COMPLEX','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',875), ('type_specifier_no_typeid -> SIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',876), ('type_specifier_no_typeid -> UNSIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',877), ('type_specifier_no_typeid -> __INT128','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',878), ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier','c_parser.py',883), ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier','c_parser.py',884), ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier','c_parser.py',885), ('type_specifier -> type_specifier_no_typeid','type_specifier',1,'p_type_specifier','c_parser.py',886), ('type_specifier -> atomic_specifier','type_specifier',1,'p_type_specifier','c_parser.py',887), ('atomic_specifier -> _ATOMIC LPAREN type_name RPAREN','atomic_specifier',4,'p_atomic_specifier','c_parser.py',893), ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','c_parser.py',900), ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','c_parser.py',901), ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','c_parser.py',902), ('type_qualifier -> _ATOMIC','type_qualifier',1,'p_type_qualifier','c_parser.py',903), ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list','c_parser.py',908), ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list','c_parser.py',909), ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','c_parser.py',917), ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','c_parser.py',918), ('id_init_declarator_list -> id_init_declarator','id_init_declarator_list',1,'p_id_init_declarator_list','c_parser.py',923), ('id_init_declarator_list -> id_init_declarator_list COMMA init_declarator','id_init_declarator_list',3,'p_id_init_declarator_list','c_parser.py',924), ('id_init_declarator -> id_declarator','id_init_declarator',1,'p_id_init_declarator','c_parser.py',929), ('id_init_declarator -> id_declarator EQUALS initializer','id_init_declarator',3,'p_id_init_declarator','c_parser.py',930), ('specifier_qualifier_list -> specifier_qualifier_list type_specifier_no_typeid','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','c_parser.py',937), ('specifier_qualifier_list -> specifier_qualifier_list type_qualifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','c_parser.py',942), ('specifier_qualifier_list -> type_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_3','c_parser.py',947), ('specifier_qualifier_list -> type_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_4','c_parser.py',952), ('specifier_qualifier_list -> alignment_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_5','c_parser.py',957), ('specifier_qualifier_list -> specifier_qualifier_list alignment_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_6','c_parser.py',962), ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',970), ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',971), ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','c_parser.py',981), ('struct_or_union_specifier -> struct_or_union brace_open brace_close','struct_or_union_specifier',3,'p_struct_or_union_specifier_2','c_parser.py',982), ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',999), ('struct_or_union_specifier -> struct_or_union ID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',1000), ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',1001), ('struct_or_union_specifier -> struct_or_union TYPEID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',1002), ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','c_parser.py',1018), ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','c_parser.py',1019), ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','c_parser.py',1026), ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','c_parser.py',1027), ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','c_parser.py',1035), ('struct_declaration -> SEMI','struct_declaration',1,'p_struct_declaration_2','c_parser.py',1073), ('struct_declaration -> pppragma_directive','struct_declaration',1,'p_struct_declaration_3','c_parser.py',1078), ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','c_parser.py',1083), ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','c_parser.py',1084), ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','c_parser.py',1092), ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','c_parser.py',1097), ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','c_parser.py',1098), ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1106), ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1107), ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','c_parser.py',1112), ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1117), ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1118), ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','c_parser.py',1123), ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','c_parser.py',1124), ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','c_parser.py',1125), ('alignment_specifier -> _ALIGNAS LPAREN type_name RPAREN','alignment_specifier',4,'p_alignment_specifier','c_parser.py',1136), ('alignment_specifier -> _ALIGNAS LPAREN constant_expression RPAREN','alignment_specifier',4,'p_alignment_specifier','c_parser.py',1137), ('enumerator -> ID','enumerator',1,'p_enumerator','c_parser.py',1142), ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','c_parser.py',1143), ('declarator -> id_declarator','declarator',1,'p_declarator','c_parser.py',1158), ('declarator -> typeid_declarator','declarator',1,'p_declarator','c_parser.py',1159), ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','c_parser.py',1271), ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','c_parser.py',1272), ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','c_parser.py',1301), ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','c_parser.py',1302), ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','c_parser.py',1307), ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','c_parser.py',1308), ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','c_parser.py',1316), ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','c_parser.py',1317), ('parameter_declaration -> declaration_specifiers id_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1336), ('parameter_declaration -> declaration_specifiers typeid_noparen_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1337), ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','c_parser.py',1348), ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','c_parser.py',1380), ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','c_parser.py',1381), ('initializer -> assignment_expression','initializer',1,'p_initializer_1','c_parser.py',1390), ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','c_parser.py',1395), ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','c_parser.py',1396), ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','c_parser.py',1404), ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','c_parser.py',1405), ('designation -> designator_list EQUALS','designation',2,'p_designation','c_parser.py',1416), ('designator_list -> designator','designator_list',1,'p_designator_list','c_parser.py',1424), ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','c_parser.py',1425), ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','c_parser.py',1430), ('designator -> PERIOD identifier','designator',2,'p_designator','c_parser.py',1431), ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','c_parser.py',1436), ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','c_parser.py',1448), ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','c_parser.py',1456), ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','c_parser.py',1461), ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','c_parser.py',1471), ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','c_parser.py',1475), ('direct_abstract_declarator -> LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_3','c_parser.py',1486), ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','c_parser.py',1496), ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','c_parser.py',1507), ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','c_parser.py',1516), ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','c_parser.py',1526), ('block_item -> declaration','block_item',1,'p_block_item','c_parser.py',1537), ('block_item -> statement','block_item',1,'p_block_item','c_parser.py',1538), ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','c_parser.py',1545), ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','c_parser.py',1546), ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','c_parser.py',1552), ('labeled_statement -> ID COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_1','c_parser.py',1558), ('labeled_statement -> CASE constant_expression COLON pragmacomp_or_statement','labeled_statement',4,'p_labeled_statement_2','c_parser.py',1562), ('labeled_statement -> DEFAULT COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_3','c_parser.py',1566), ('selection_statement -> IF LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_1','c_parser.py',1570), ('selection_statement -> IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement','selection_statement',7,'p_selection_statement_2','c_parser.py',1574), ('selection_statement -> SWITCH LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_3','c_parser.py',1578), ('iteration_statement -> WHILE LPAREN expression RPAREN pragmacomp_or_statement','iteration_statement',5,'p_iteration_statement_1','c_parser.py',1583), ('iteration_statement -> DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','c_parser.py',1587), ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',9,'p_iteration_statement_3','c_parser.py',1591), ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',8,'p_iteration_statement_4','c_parser.py',1595), ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','c_parser.py',1600), ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','c_parser.py',1604), ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','c_parser.py',1608), ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','c_parser.py',1612), ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','c_parser.py',1613), ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','c_parser.py',1618), ('expression -> assignment_expression','expression',1,'p_expression','c_parser.py',1625), ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','c_parser.py',1626), ('assignment_expression -> LPAREN compound_statement RPAREN','assignment_expression',3,'p_parenthesized_compound_expression','c_parser.py',1638), ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','c_parser.py',1642), ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','c_parser.py',1646), ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','c_parser.py',1647), ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','c_parser.py',1660), ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1661), ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1662), ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1663), ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1664), ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1665), ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1666), ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1667), ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1668), ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1669), ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1670), ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','c_parser.py',1675), ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','c_parser.py',1679), ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','c_parser.py',1680), ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','c_parser.py',1688), ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1689), ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1690), ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1691), ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1692), ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1693), ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1694), ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1695), ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1696), ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1697), ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1698), ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1699), ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1700), ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1701), ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1702), ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1703), ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1704), ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1705), ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1706), ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','c_parser.py',1714), ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','c_parser.py',1718), ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','c_parser.py',1722), ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1726), ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1727), ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1728), ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','c_parser.py',1733), ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1734), ('unary_expression -> _ALIGNOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1735), ('unary_operator -> AND','unary_operator',1,'p_unary_operator','c_parser.py',1743), ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','c_parser.py',1744), ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','c_parser.py',1745), ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','c_parser.py',1746), ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','c_parser.py',1747), ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','c_parser.py',1748), ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','c_parser.py',1753), ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','c_parser.py',1757), ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','c_parser.py',1761), ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','c_parser.py',1762), ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1767), ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1768), ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1769), ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1770), ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1776), ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1777), ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','c_parser.py',1782), ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','c_parser.py',1783), ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','c_parser.py',1788), ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','c_parser.py',1792), ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1796), ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1797), ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','c_parser.py',1802), ('primary_expression -> OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN','primary_expression',6,'p_primary_expression_5','c_parser.py',1806), ('offsetof_member_designator -> identifier','offsetof_member_designator',1,'p_offsetof_member_designator','c_parser.py',1814), ('offsetof_member_designator -> offsetof_member_designator PERIOD identifier','offsetof_member_designator',3,'p_offsetof_member_designator','c_parser.py',1815), ('offsetof_member_designator -> offsetof_member_designator LBRACKET expression RBRACKET','offsetof_member_designator',4,'p_offsetof_member_designator','c_parser.py',1816), ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','c_parser.py',1828), ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','c_parser.py',1829), ('identifier -> ID','identifier',1,'p_identifier','c_parser.py',1838), ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','c_parser.py',1842), ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','c_parser.py',1843), ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','c_parser.py',1844), ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','c_parser.py',1845), ('constant -> INT_CONST_CHAR','constant',1,'p_constant_1','c_parser.py',1846), ('constant -> FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1865), ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1866), ('constant -> CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1882), ('constant -> WCHAR_CONST','constant',1,'p_constant_3','c_parser.py',1883), ('constant -> U8CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1884), ('constant -> U16CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1885), ('constant -> U32CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1886), ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','c_parser.py',1897), ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','c_parser.py',1898), ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1908), ('unified_wstring_literal -> U8STRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1909), ('unified_wstring_literal -> U16STRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1910), ('unified_wstring_literal -> U32STRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1911), ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1912), ('unified_wstring_literal -> unified_wstring_literal U8STRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1913), ('unified_wstring_literal -> unified_wstring_literal U16STRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1914), ('unified_wstring_literal -> unified_wstring_literal U32STRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1915), ('brace_open -> LBRACE','brace_open',1,'p_brace_open','c_parser.py',1925), ('brace_close -> RBRACE','brace_close',1,'p_brace_close','c_parser.py',1931), ('empty -> ','empty',0,'p_empty','c_parser.py',1937), ] ply/__init__.py000064400000000146147205113120007456 0ustar00# PLY package # Author: David Beazley (dave@dabeaz.com) __version__ = '3.9' __all__ = ['lex','yacc'] ply/cpp.py000064400000101002147205113120006472 0ustar00# ----------------------------------------------------------------------------- # cpp.py # # Author: David Beazley (http://www.dabeaz.com) # Copyright (C) 2017 # All rights reserved # # This module implements an ANSI-C style lexical preprocessor for PLY. # ----------------------------------------------------------------------------- import sys # Some Python 3 compatibility shims if sys.version_info.major < 3: STRING_TYPES = (str, unicode) else: STRING_TYPES = str xrange = range # ----------------------------------------------------------------------------- # Default preprocessor lexer definitions. These tokens are enough to get # a basic preprocessor working. Other modules may import these if they want # ----------------------------------------------------------------------------- tokens = ( 'CPP_ID','CPP_INTEGER', 'CPP_FLOAT', 'CPP_STRING', 'CPP_CHAR', 'CPP_WS', 'CPP_COMMENT1', 'CPP_COMMENT2', 'CPP_POUND','CPP_DPOUND' ) literals = "+-*/%|&~^<>=!?()[]{}.,;:\\\'\"" # Whitespace def t_CPP_WS(t): r'\s+' t.lexer.lineno += t.value.count("\n") return t t_CPP_POUND = r'\#' t_CPP_DPOUND = r'\#\#' # Identifier t_CPP_ID = r'[A-Za-z_][\w_]*' # Integer literal def CPP_INTEGER(t): r'(((((0x)|(0X))[0-9a-fA-F]+)|(\d+))([uU][lL]|[lL][uU]|[uU]|[lL])?)' return t t_CPP_INTEGER = CPP_INTEGER # Floating literal t_CPP_FLOAT = r'((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?' # String literal def t_CPP_STRING(t): r'\"([^\\\n]|(\\(.|\n)))*?\"' t.lexer.lineno += t.value.count("\n") return t # Character constant 'c' or L'c' def t_CPP_CHAR(t): r'(L)?\'([^\\\n]|(\\(.|\n)))*?\'' t.lexer.lineno += t.value.count("\n") return t # Comment def t_CPP_COMMENT1(t): r'(/\*(.|\n)*?\*/)' ncr = t.value.count("\n") t.lexer.lineno += ncr # replace with one space or a number of '\n' t.type = 'CPP_WS'; t.value = '\n' * ncr if ncr else ' ' return t # Line comment def t_CPP_COMMENT2(t): r'(//.*?(\n|$))' # replace with '/n' t.type = 'CPP_WS'; t.value = '\n' return t def t_error(t): t.type = t.value[0] t.value = t.value[0] t.lexer.skip(1) return t import re import copy import time import os.path # ----------------------------------------------------------------------------- # trigraph() # # Given an input string, this function replaces all trigraph sequences. # The following mapping is used: # # ??= # # ??/ \ # ??' ^ # ??( [ # ??) ] # ??! | # ??< { # ??> } # ??- ~ # ----------------------------------------------------------------------------- _trigraph_pat = re.compile(r'''\?\?[=/\'\(\)\!<>\-]''') _trigraph_rep = { '=':'#', '/':'\\', "'":'^', '(':'[', ')':']', '!':'|', '<':'{', '>':'}', '-':'~' } def trigraph(input): return _trigraph_pat.sub(lambda g: _trigraph_rep[g.group()[-1]],input) # ------------------------------------------------------------------ # Macro object # # This object holds information about preprocessor macros # # .name - Macro name (string) # .value - Macro value (a list of tokens) # .arglist - List of argument names # .variadic - Boolean indicating whether or not variadic macro # .vararg - Name of the variadic parameter # # When a macro is created, the macro replacement token sequence is # pre-scanned and used to create patch lists that are later used # during macro expansion # ------------------------------------------------------------------ class Macro(object): def __init__(self,name,value,arglist=None,variadic=False): self.name = name self.value = value self.arglist = arglist self.variadic = variadic if variadic: self.vararg = arglist[-1] self.source = None # ------------------------------------------------------------------ # Preprocessor object # # Object representing a preprocessor. Contains macro definitions, # include directories, and other information # ------------------------------------------------------------------ class Preprocessor(object): def __init__(self,lexer=None): if lexer is None: lexer = lex.lexer self.lexer = lexer self.macros = { } self.path = [] self.temp_path = [] # Probe the lexer for selected tokens self.lexprobe() tm = time.localtime() self.define("__DATE__ \"%s\"" % time.strftime("%b %d %Y",tm)) self.define("__TIME__ \"%s\"" % time.strftime("%H:%M:%S",tm)) self.parser = None # ----------------------------------------------------------------------------- # tokenize() # # Utility function. Given a string of text, tokenize into a list of tokens # ----------------------------------------------------------------------------- def tokenize(self,text): tokens = [] self.lexer.input(text) while True: tok = self.lexer.token() if not tok: break tokens.append(tok) return tokens # --------------------------------------------------------------------- # error() # # Report a preprocessor error/warning of some kind # ---------------------------------------------------------------------- def error(self,file,line,msg): print("%s:%d %s" % (file,line,msg)) # ---------------------------------------------------------------------- # lexprobe() # # This method probes the preprocessor lexer object to discover # the token types of symbols that are important to the preprocessor. # If this works right, the preprocessor will simply "work" # with any suitable lexer regardless of how tokens have been named. # ---------------------------------------------------------------------- def lexprobe(self): # Determine the token type for identifiers self.lexer.input("identifier") tok = self.lexer.token() if not tok or tok.value != "identifier": print("Couldn't determine identifier type") else: self.t_ID = tok.type # Determine the token type for integers self.lexer.input("12345") tok = self.lexer.token() if not tok or int(tok.value) != 12345: print("Couldn't determine integer type") else: self.t_INTEGER = tok.type self.t_INTEGER_TYPE = type(tok.value) # Determine the token type for strings enclosed in double quotes self.lexer.input("\"filename\"") tok = self.lexer.token() if not tok or tok.value != "\"filename\"": print("Couldn't determine string type") else: self.t_STRING = tok.type # Determine the token type for whitespace--if any self.lexer.input(" ") tok = self.lexer.token() if not tok or tok.value != " ": self.t_SPACE = None else: self.t_SPACE = tok.type # Determine the token type for newlines self.lexer.input("\n") tok = self.lexer.token() if not tok or tok.value != "\n": self.t_NEWLINE = None print("Couldn't determine token for newlines") else: self.t_NEWLINE = tok.type self.t_WS = (self.t_SPACE, self.t_NEWLINE) # Check for other characters used by the preprocessor chars = [ '<','>','#','##','\\','(',')',',','.'] for c in chars: self.lexer.input(c) tok = self.lexer.token() if not tok or tok.value != c: print("Unable to lex '%s' required for preprocessor" % c) # ---------------------------------------------------------------------- # add_path() # # Adds a search path to the preprocessor. # ---------------------------------------------------------------------- def add_path(self,path): self.path.append(path) # ---------------------------------------------------------------------- # group_lines() # # Given an input string, this function splits it into lines. Trailing whitespace # is removed. Any line ending with \ is grouped with the next line. This # function forms the lowest level of the preprocessor---grouping into text into # a line-by-line format. # ---------------------------------------------------------------------- def group_lines(self,input): lex = self.lexer.clone() lines = [x.rstrip() for x in input.splitlines()] for i in xrange(len(lines)): j = i+1 while lines[i].endswith('\\') and (j < len(lines)): lines[i] = lines[i][:-1]+lines[j] lines[j] = "" j += 1 input = "\n".join(lines) lex.input(input) lex.lineno = 1 current_line = [] while True: tok = lex.token() if not tok: break current_line.append(tok) if tok.type in self.t_WS and '\n' in tok.value: yield current_line current_line = [] if current_line: yield current_line # ---------------------------------------------------------------------- # tokenstrip() # # Remove leading/trailing whitespace tokens from a token list # ---------------------------------------------------------------------- def tokenstrip(self,tokens): i = 0 while i < len(tokens) and tokens[i].type in self.t_WS: i += 1 del tokens[:i] i = len(tokens)-1 while i >= 0 and tokens[i].type in self.t_WS: i -= 1 del tokens[i+1:] return tokens # ---------------------------------------------------------------------- # collect_args() # # Collects comma separated arguments from a list of tokens. The arguments # must be enclosed in parenthesis. Returns a tuple (tokencount,args,positions) # where tokencount is the number of tokens consumed, args is a list of arguments, # and positions is a list of integers containing the starting index of each # argument. Each argument is represented by a list of tokens. # # When collecting arguments, leading and trailing whitespace is removed # from each argument. # # This function properly handles nested parenthesis and commas---these do not # define new arguments. # ---------------------------------------------------------------------- def collect_args(self,tokenlist): args = [] positions = [] current_arg = [] nesting = 1 tokenlen = len(tokenlist) # Search for the opening '('. i = 0 while (i < tokenlen) and (tokenlist[i].type in self.t_WS): i += 1 if (i < tokenlen) and (tokenlist[i].value == '('): positions.append(i+1) else: self.error(self.source,tokenlist[0].lineno,"Missing '(' in macro arguments") return 0, [], [] i += 1 while i < tokenlen: t = tokenlist[i] if t.value == '(': current_arg.append(t) nesting += 1 elif t.value == ')': nesting -= 1 if nesting == 0: if current_arg: args.append(self.tokenstrip(current_arg)) positions.append(i) return i+1,args,positions current_arg.append(t) elif t.value == ',' and nesting == 1: args.append(self.tokenstrip(current_arg)) positions.append(i+1) current_arg = [] else: current_arg.append(t) i += 1 # Missing end argument self.error(self.source,tokenlist[-1].lineno,"Missing ')' in macro arguments") return 0, [],[] # ---------------------------------------------------------------------- # macro_prescan() # # Examine the macro value (token sequence) and identify patch points # This is used to speed up macro expansion later on---we'll know # right away where to apply patches to the value to form the expansion # ---------------------------------------------------------------------- def macro_prescan(self,macro): macro.patch = [] # Standard macro arguments macro.str_patch = [] # String conversion expansion macro.var_comma_patch = [] # Variadic macro comma patch i = 0 while i < len(macro.value): if macro.value[i].type == self.t_ID and macro.value[i].value in macro.arglist: argnum = macro.arglist.index(macro.value[i].value) # Conversion of argument to a string if i > 0 and macro.value[i-1].value == '#': macro.value[i] = copy.copy(macro.value[i]) macro.value[i].type = self.t_STRING del macro.value[i-1] macro.str_patch.append((argnum,i-1)) continue # Concatenation elif (i > 0 and macro.value[i-1].value == '##'): macro.patch.append(('c',argnum,i-1)) del macro.value[i-1] continue elif ((i+1) < len(macro.value) and macro.value[i+1].value == '##'): macro.patch.append(('c',argnum,i)) i += 1 continue # Standard expansion else: macro.patch.append(('e',argnum,i)) elif macro.value[i].value == '##': if macro.variadic and (i > 0) and (macro.value[i-1].value == ',') and \ ((i+1) < len(macro.value)) and (macro.value[i+1].type == self.t_ID) and \ (macro.value[i+1].value == macro.vararg): macro.var_comma_patch.append(i-1) i += 1 macro.patch.sort(key=lambda x: x[2],reverse=True) # ---------------------------------------------------------------------- # macro_expand_args() # # Given a Macro and list of arguments (each a token list), this method # returns an expanded version of a macro. The return value is a token sequence # representing the replacement macro tokens # ---------------------------------------------------------------------- def macro_expand_args(self,macro,args): # Make a copy of the macro token sequence rep = [copy.copy(_x) for _x in macro.value] # Make string expansion patches. These do not alter the length of the replacement sequence str_expansion = {} for argnum, i in macro.str_patch: if argnum not in str_expansion: str_expansion[argnum] = ('"%s"' % "".join([x.value for x in args[argnum]])).replace("\\","\\\\") rep[i] = copy.copy(rep[i]) rep[i].value = str_expansion[argnum] # Make the variadic macro comma patch. If the variadic macro argument is empty, we get rid comma_patch = False if macro.variadic and not args[-1]: for i in macro.var_comma_patch: rep[i] = None comma_patch = True # Make all other patches. The order of these matters. It is assumed that the patch list # has been sorted in reverse order of patch location since replacements will cause the # size of the replacement sequence to expand from the patch point. expanded = { } for ptype, argnum, i in macro.patch: # Concatenation. Argument is left unexpanded if ptype == 'c': rep[i:i+1] = args[argnum] # Normal expansion. Argument is macro expanded first elif ptype == 'e': if argnum not in expanded: expanded[argnum] = self.expand_macros(args[argnum]) rep[i:i+1] = expanded[argnum] # Get rid of removed comma if necessary if comma_patch: rep = [_i for _i in rep if _i] return rep # ---------------------------------------------------------------------- # expand_macros() # # Given a list of tokens, this function performs macro expansion. # The expanded argument is a dictionary that contains macros already # expanded. This is used to prevent infinite recursion. # ---------------------------------------------------------------------- def expand_macros(self,tokens,expanded=None): if expanded is None: expanded = {} i = 0 while i < len(tokens): t = tokens[i] if t.type == self.t_ID: if t.value in self.macros and t.value not in expanded: # Yes, we found a macro match expanded[t.value] = True m = self.macros[t.value] if not m.arglist: # A simple macro ex = self.expand_macros([copy.copy(_x) for _x in m.value],expanded) for e in ex: e.lineno = t.lineno tokens[i:i+1] = ex i += len(ex) else: # A macro with arguments j = i + 1 while j < len(tokens) and tokens[j].type in self.t_WS: j += 1 if tokens[j].value == '(': tokcount,args,positions = self.collect_args(tokens[j:]) if not m.variadic and len(args) != len(m.arglist): self.error(self.source,t.lineno,"Macro %s requires %d arguments" % (t.value,len(m.arglist))) i = j + tokcount elif m.variadic and len(args) < len(m.arglist)-1: if len(m.arglist) > 2: self.error(self.source,t.lineno,"Macro %s must have at least %d arguments" % (t.value, len(m.arglist)-1)) else: self.error(self.source,t.lineno,"Macro %s must have at least %d argument" % (t.value, len(m.arglist)-1)) i = j + tokcount else: if m.variadic: if len(args) == len(m.arglist)-1: args.append([]) else: args[len(m.arglist)-1] = tokens[j+positions[len(m.arglist)-1]:j+tokcount-1] del args[len(m.arglist):] # Get macro replacement text rep = self.macro_expand_args(m,args) rep = self.expand_macros(rep,expanded) for r in rep: r.lineno = t.lineno tokens[i:j+tokcount] = rep i += len(rep) del expanded[t.value] continue elif t.value == '__LINE__': t.type = self.t_INTEGER t.value = self.t_INTEGER_TYPE(t.lineno) i += 1 return tokens # ---------------------------------------------------------------------- # evalexpr() # # Evaluate an expression token sequence for the purposes of evaluating # integral expressions. # ---------------------------------------------------------------------- def evalexpr(self,tokens): # tokens = tokenize(line) # Search for defined macros i = 0 while i < len(tokens): if tokens[i].type == self.t_ID and tokens[i].value == 'defined': j = i + 1 needparen = False result = "0L" while j < len(tokens): if tokens[j].type in self.t_WS: j += 1 continue elif tokens[j].type == self.t_ID: if tokens[j].value in self.macros: result = "1L" else: result = "0L" if not needparen: break elif tokens[j].value == '(': needparen = True elif tokens[j].value == ')': break else: self.error(self.source,tokens[i].lineno,"Malformed defined()") j += 1 tokens[i].type = self.t_INTEGER tokens[i].value = self.t_INTEGER_TYPE(result) del tokens[i+1:j+1] i += 1 tokens = self.expand_macros(tokens) for i,t in enumerate(tokens): if t.type == self.t_ID: tokens[i] = copy.copy(t) tokens[i].type = self.t_INTEGER tokens[i].value = self.t_INTEGER_TYPE("0L") elif t.type == self.t_INTEGER: tokens[i] = copy.copy(t) # Strip off any trailing suffixes tokens[i].value = str(tokens[i].value) while tokens[i].value[-1] not in "0123456789abcdefABCDEF": tokens[i].value = tokens[i].value[:-1] expr = "".join([str(x.value) for x in tokens]) expr = expr.replace("&&"," and ") expr = expr.replace("||"," or ") expr = expr.replace("!"," not ") try: result = eval(expr) except Exception: self.error(self.source,tokens[0].lineno,"Couldn't evaluate expression") result = 0 return result # ---------------------------------------------------------------------- # parsegen() # # Parse an input string/ # ---------------------------------------------------------------------- def parsegen(self,input,source=None): # Replace trigraph sequences t = trigraph(input) lines = self.group_lines(t) if not source: source = "" self.define("__FILE__ \"%s\"" % source) self.source = source chunk = [] enable = True iftrigger = False ifstack = [] for x in lines: for i,tok in enumerate(x): if tok.type not in self.t_WS: break if tok.value == '#': # Preprocessor directive # insert necessary whitespace instead of eaten tokens for tok in x: if tok.type in self.t_WS and '\n' in tok.value: chunk.append(tok) dirtokens = self.tokenstrip(x[i+1:]) if dirtokens: name = dirtokens[0].value args = self.tokenstrip(dirtokens[1:]) else: name = "" args = [] if name == 'define': if enable: for tok in self.expand_macros(chunk): yield tok chunk = [] self.define(args) elif name == 'include': if enable: for tok in self.expand_macros(chunk): yield tok chunk = [] oldfile = self.macros['__FILE__'] for tok in self.include(args): yield tok self.macros['__FILE__'] = oldfile self.source = source elif name == 'undef': if enable: for tok in self.expand_macros(chunk): yield tok chunk = [] self.undef(args) elif name == 'ifdef': ifstack.append((enable,iftrigger)) if enable: if not args[0].value in self.macros: enable = False iftrigger = False else: iftrigger = True elif name == 'ifndef': ifstack.append((enable,iftrigger)) if enable: if args[0].value in self.macros: enable = False iftrigger = False else: iftrigger = True elif name == 'if': ifstack.append((enable,iftrigger)) if enable: result = self.evalexpr(args) if not result: enable = False iftrigger = False else: iftrigger = True elif name == 'elif': if ifstack: if ifstack[-1][0]: # We only pay attention if outer "if" allows this if enable: # If already true, we flip enable False enable = False elif not iftrigger: # If False, but not triggered yet, we'll check expression result = self.evalexpr(args) if result: enable = True iftrigger = True else: self.error(self.source,dirtokens[0].lineno,"Misplaced #elif") elif name == 'else': if ifstack: if ifstack[-1][0]: if enable: enable = False elif not iftrigger: enable = True iftrigger = True else: self.error(self.source,dirtokens[0].lineno,"Misplaced #else") elif name == 'endif': if ifstack: enable,iftrigger = ifstack.pop() else: self.error(self.source,dirtokens[0].lineno,"Misplaced #endif") else: # Unknown preprocessor directive pass else: # Normal text if enable: chunk.extend(x) for tok in self.expand_macros(chunk): yield tok chunk = [] # ---------------------------------------------------------------------- # include() # # Implementation of file-inclusion # ---------------------------------------------------------------------- def include(self,tokens): # Try to extract the filename and then process an include file if not tokens: return if tokens: if tokens[0].value != '<' and tokens[0].type != self.t_STRING: tokens = self.expand_macros(tokens) if tokens[0].value == '<': # Include <...> i = 1 while i < len(tokens): if tokens[i].value == '>': break i += 1 else: print("Malformed #include <...>") return filename = "".join([x.value for x in tokens[1:i]]) path = self.path + [""] + self.temp_path elif tokens[0].type == self.t_STRING: filename = tokens[0].value[1:-1] path = self.temp_path + [""] + self.path else: print("Malformed #include statement") return for p in path: iname = os.path.join(p,filename) try: data = open(iname,"r").read() dname = os.path.dirname(iname) if dname: self.temp_path.insert(0,dname) for tok in self.parsegen(data,filename): yield tok if dname: del self.temp_path[0] break except IOError: pass else: print("Couldn't find '%s'" % filename) # ---------------------------------------------------------------------- # define() # # Define a new macro # ---------------------------------------------------------------------- def define(self,tokens): if isinstance(tokens,STRING_TYPES): tokens = self.tokenize(tokens) linetok = tokens try: name = linetok[0] if len(linetok) > 1: mtype = linetok[1] else: mtype = None if not mtype: m = Macro(name.value,[]) self.macros[name.value] = m elif mtype.type in self.t_WS: # A normal macro m = Macro(name.value,self.tokenstrip(linetok[2:])) self.macros[name.value] = m elif mtype.value == '(': # A macro with arguments tokcount, args, positions = self.collect_args(linetok[1:]) variadic = False for a in args: if variadic: print("No more arguments may follow a variadic argument") break astr = "".join([str(_i.value) for _i in a]) if astr == "...": variadic = True a[0].type = self.t_ID a[0].value = '__VA_ARGS__' variadic = True del a[1:] continue elif astr[-3:] == "..." and a[0].type == self.t_ID: variadic = True del a[1:] # If, for some reason, "." is part of the identifier, strip off the name for the purposes # of macro expansion if a[0].value[-3:] == '...': a[0].value = a[0].value[:-3] continue if len(a) > 1 or a[0].type != self.t_ID: print("Invalid macro argument") break else: mvalue = self.tokenstrip(linetok[1+tokcount:]) i = 0 while i < len(mvalue): if i+1 < len(mvalue): if mvalue[i].type in self.t_WS and mvalue[i+1].value == '##': del mvalue[i] continue elif mvalue[i].value == '##' and mvalue[i+1].type in self.t_WS: del mvalue[i+1] i += 1 m = Macro(name.value,mvalue,[x[0].value for x in args],variadic) self.macro_prescan(m) self.macros[name.value] = m else: print("Bad macro definition") except LookupError: print("Bad macro definition") # ---------------------------------------------------------------------- # undef() # # Undefine a macro # ---------------------------------------------------------------------- def undef(self,tokens): id = tokens[0].value try: del self.macros[id] except LookupError: pass # ---------------------------------------------------------------------- # parse() # # Parse input text. # ---------------------------------------------------------------------- def parse(self,input,source=None,ignore={}): self.ignore = ignore self.parser = self.parsegen(input,source) # ---------------------------------------------------------------------- # token() # # Method to return individual tokens # ---------------------------------------------------------------------- def token(self): try: while True: tok = next(self.parser) if tok.type not in self.ignore: return tok except StopIteration: self.parser = None return None if __name__ == '__main__': import ply.lex as lex lexer = lex.lex() # Run a preprocessor import sys f = open(sys.argv[1]) input = f.read() p = Preprocessor(lexer) p.parse(input,sys.argv[1]) while True: tok = p.token() if not tok: break print(p.source, tok) ply/ctokens.py000064400000006151147205113120007367 0ustar00# ---------------------------------------------------------------------- # ctokens.py # # Token specifications for symbols in ANSI C and C++. This file is # meant to be used as a library in other tokenizers. # ---------------------------------------------------------------------- # Reserved words tokens = [ # Literals (identifier, integer constant, float constant, string constant, char const) 'ID', 'TYPEID', 'INTEGER', 'FLOAT', 'STRING', 'CHARACTER', # Operators (+,-,*,/,%,|,&,~,^,<<,>>, ||, &&, !, <, <=, >, >=, ==, !=) 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MODULO', 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', 'LOR', 'LAND', 'LNOT', 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', # Assignment (=, *=, /=, %=, +=, -=, <<=, >>=, &=, ^=, |=) 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', 'PLUSEQUAL', 'MINUSEQUAL', 'LSHIFTEQUAL','RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', 'OREQUAL', # Increment/decrement (++,--) 'INCREMENT', 'DECREMENT', # Structure dereference (->) 'ARROW', # Ternary operator (?) 'TERNARY', # Delimeters ( ) [ ] { } , . ; : 'LPAREN', 'RPAREN', 'LBRACKET', 'RBRACKET', 'LBRACE', 'RBRACE', 'COMMA', 'PERIOD', 'SEMI', 'COLON', # Ellipsis (...) 'ELLIPSIS', ] # Operators t_PLUS = r'\+' t_MINUS = r'-' t_TIMES = r'\*' t_DIVIDE = r'/' t_MODULO = r'%' t_OR = r'\|' t_AND = r'&' t_NOT = r'~' t_XOR = r'\^' t_LSHIFT = r'<<' t_RSHIFT = r'>>' t_LOR = r'\|\|' t_LAND = r'&&' t_LNOT = r'!' t_LT = r'<' t_GT = r'>' t_LE = r'<=' t_GE = r'>=' t_EQ = r'==' t_NE = r'!=' # Assignment operators t_EQUALS = r'=' t_TIMESEQUAL = r'\*=' t_DIVEQUAL = r'/=' t_MODEQUAL = r'%=' t_PLUSEQUAL = r'\+=' t_MINUSEQUAL = r'-=' t_LSHIFTEQUAL = r'<<=' t_RSHIFTEQUAL = r'>>=' t_ANDEQUAL = r'&=' t_OREQUAL = r'\|=' t_XOREQUAL = r'\^=' # Increment/decrement t_INCREMENT = r'\+\+' t_DECREMENT = r'--' # -> t_ARROW = r'->' # ? t_TERNARY = r'\?' # Delimeters t_LPAREN = r'\(' t_RPAREN = r'\)' t_LBRACKET = r'\[' t_RBRACKET = r'\]' t_LBRACE = r'\{' t_RBRACE = r'\}' t_COMMA = r',' t_PERIOD = r'\.' t_SEMI = r';' t_COLON = r':' t_ELLIPSIS = r'\.\.\.' # Identifiers t_ID = r'[A-Za-z_][A-Za-z0-9_]*' # Integer literal t_INTEGER = r'\d+([uU]|[lL]|[uU][lL]|[lL][uU])?' # Floating literal t_FLOAT = r'((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?' # String literal t_STRING = r'\"([^\\\n]|(\\.))*?\"' # Character constant 'c' or L'c' t_CHARACTER = r'(L)?\'([^\\\n]|(\\.))*?\'' # Comment (C-Style) def t_COMMENT(t): r'/\*(.|\n)*?\*/' t.lexer.lineno += t.value.count('\n') return t # Comment (C++-Style) def t_CPPCOMMENT(t): r'//.*\n' t.lexer.lineno += 1 return t ply/lex.py000064400000123656147205113120006523 0ustar00# ----------------------------------------------------------------------------- # ply: lex.py # # Copyright (C) 2001-2017 # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # * Neither the name of the David Beazley or Dabeaz LLC may be used to # endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ----------------------------------------------------------------------------- __version__ = '3.10' __tabversion__ = '3.10' import re import sys import types import copy import os import inspect # This tuple contains known string types try: # Python 2.6 StringTypes = (types.StringType, types.UnicodeType) except AttributeError: # Python 3.0 StringTypes = (str, bytes) # This regular expression is used to match valid token names _is_identifier = re.compile(r'^[a-zA-Z0-9_]+$') # Exception thrown when invalid token encountered and no default error # handler is defined. class LexError(Exception): def __init__(self, message, s): self.args = (message,) self.text = s # Token class. This class is used to represent the tokens produced. class LexToken(object): def __str__(self): return 'LexToken(%s,%r,%d,%d)' % (self.type, self.value, self.lineno, self.lexpos) def __repr__(self): return str(self) # This object is a stand-in for a logging object created by the # logging module. class PlyLogger(object): def __init__(self, f): self.f = f def critical(self, msg, *args, **kwargs): self.f.write((msg % args) + '\n') def warning(self, msg, *args, **kwargs): self.f.write('WARNING: ' + (msg % args) + '\n') def error(self, msg, *args, **kwargs): self.f.write('ERROR: ' + (msg % args) + '\n') info = critical debug = critical # Null logger is used when no output is generated. Does nothing. class NullLogger(object): def __getattribute__(self, name): return self def __call__(self, *args, **kwargs): return self # ----------------------------------------------------------------------------- # === Lexing Engine === # # The following Lexer class implements the lexer runtime. There are only # a few public methods and attributes: # # input() - Store a new string in the lexer # token() - Get the next token # clone() - Clone the lexer # # lineno - Current line number # lexpos - Current position in the input string # ----------------------------------------------------------------------------- class Lexer: def __init__(self): self.lexre = None # Master regular expression. This is a list of # tuples (re, findex) where re is a compiled # regular expression and findex is a list # mapping regex group numbers to rules self.lexretext = None # Current regular expression strings self.lexstatere = {} # Dictionary mapping lexer states to master regexs self.lexstateretext = {} # Dictionary mapping lexer states to regex strings self.lexstaterenames = {} # Dictionary mapping lexer states to symbol names self.lexstate = 'INITIAL' # Current lexer state self.lexstatestack = [] # Stack of lexer states self.lexstateinfo = None # State information self.lexstateignore = {} # Dictionary of ignored characters for each state self.lexstateerrorf = {} # Dictionary of error functions for each state self.lexstateeoff = {} # Dictionary of eof functions for each state self.lexreflags = 0 # Optional re compile flags self.lexdata = None # Actual input data (as a string) self.lexpos = 0 # Current position in input text self.lexlen = 0 # Length of the input text self.lexerrorf = None # Error rule (if any) self.lexeoff = None # EOF rule (if any) self.lextokens = None # List of valid tokens self.lexignore = '' # Ignored characters self.lexliterals = '' # Literal characters that can be passed through self.lexmodule = None # Module self.lineno = 1 # Current line number self.lexoptimize = False # Optimized mode def clone(self, object=None): c = copy.copy(self) # If the object parameter has been supplied, it means we are attaching the # lexer to a new object. In this case, we have to rebind all methods in # the lexstatere and lexstateerrorf tables. if object: newtab = {} for key, ritem in self.lexstatere.items(): newre = [] for cre, findex in ritem: newfindex = [] for f in findex: if not f or not f[0]: newfindex.append(f) continue newfindex.append((getattr(object, f[0].__name__), f[1])) newre.append((cre, newfindex)) newtab[key] = newre c.lexstatere = newtab c.lexstateerrorf = {} for key, ef in self.lexstateerrorf.items(): c.lexstateerrorf[key] = getattr(object, ef.__name__) c.lexmodule = object return c # ------------------------------------------------------------ # writetab() - Write lexer information to a table file # ------------------------------------------------------------ def writetab(self, lextab, outputdir=''): if isinstance(lextab, types.ModuleType): raise IOError("Won't overwrite existing lextab module") basetabmodule = lextab.split('.')[-1] filename = os.path.join(outputdir, basetabmodule) + '.py' with open(filename, 'w') as tf: tf.write('# %s.py. This file automatically created by PLY (version %s). Don\'t edit!\n' % (basetabmodule, __version__)) tf.write('_tabversion = %s\n' % repr(__tabversion__)) tf.write('_lextokens = set(%s)\n' % repr(tuple(sorted(self.lextokens)))) tf.write('_lexreflags = %s\n' % repr(self.lexreflags)) tf.write('_lexliterals = %s\n' % repr(self.lexliterals)) tf.write('_lexstateinfo = %s\n' % repr(self.lexstateinfo)) # Rewrite the lexstatere table, replacing function objects with function names tabre = {} for statename, lre in self.lexstatere.items(): titem = [] for (pat, func), retext, renames in zip(lre, self.lexstateretext[statename], self.lexstaterenames[statename]): titem.append((retext, _funcs_to_names(func, renames))) tabre[statename] = titem tf.write('_lexstatere = %s\n' % repr(tabre)) tf.write('_lexstateignore = %s\n' % repr(self.lexstateignore)) taberr = {} for statename, ef in self.lexstateerrorf.items(): taberr[statename] = ef.__name__ if ef else None tf.write('_lexstateerrorf = %s\n' % repr(taberr)) tabeof = {} for statename, ef in self.lexstateeoff.items(): tabeof[statename] = ef.__name__ if ef else None tf.write('_lexstateeoff = %s\n' % repr(tabeof)) # ------------------------------------------------------------ # readtab() - Read lexer information from a tab file # ------------------------------------------------------------ def readtab(self, tabfile, fdict): if isinstance(tabfile, types.ModuleType): lextab = tabfile else: exec('import %s' % tabfile) lextab = sys.modules[tabfile] if getattr(lextab, '_tabversion', '0.0') != __tabversion__: raise ImportError('Inconsistent PLY version') self.lextokens = lextab._lextokens self.lexreflags = lextab._lexreflags self.lexliterals = lextab._lexliterals self.lextokens_all = self.lextokens | set(self.lexliterals) self.lexstateinfo = lextab._lexstateinfo self.lexstateignore = lextab._lexstateignore self.lexstatere = {} self.lexstateretext = {} for statename, lre in lextab._lexstatere.items(): titem = [] txtitem = [] for pat, func_name in lre: titem.append((re.compile(pat, lextab._lexreflags), _names_to_funcs(func_name, fdict))) self.lexstatere[statename] = titem self.lexstateretext[statename] = txtitem self.lexstateerrorf = {} for statename, ef in lextab._lexstateerrorf.items(): self.lexstateerrorf[statename] = fdict[ef] self.lexstateeoff = {} for statename, ef in lextab._lexstateeoff.items(): self.lexstateeoff[statename] = fdict[ef] self.begin('INITIAL') # ------------------------------------------------------------ # input() - Push a new string into the lexer # ------------------------------------------------------------ def input(self, s): # Pull off the first character to see if s looks like a string c = s[:1] if not isinstance(c, StringTypes): raise ValueError('Expected a string') self.lexdata = s self.lexpos = 0 self.lexlen = len(s) # ------------------------------------------------------------ # begin() - Changes the lexing state # ------------------------------------------------------------ def begin(self, state): if state not in self.lexstatere: raise ValueError('Undefined state') self.lexre = self.lexstatere[state] self.lexretext = self.lexstateretext[state] self.lexignore = self.lexstateignore.get(state, '') self.lexerrorf = self.lexstateerrorf.get(state, None) self.lexeoff = self.lexstateeoff.get(state, None) self.lexstate = state # ------------------------------------------------------------ # push_state() - Changes the lexing state and saves old on stack # ------------------------------------------------------------ def push_state(self, state): self.lexstatestack.append(self.lexstate) self.begin(state) # ------------------------------------------------------------ # pop_state() - Restores the previous state # ------------------------------------------------------------ def pop_state(self): self.begin(self.lexstatestack.pop()) # ------------------------------------------------------------ # current_state() - Returns the current lexing state # ------------------------------------------------------------ def current_state(self): return self.lexstate # ------------------------------------------------------------ # skip() - Skip ahead n characters # ------------------------------------------------------------ def skip(self, n): self.lexpos += n # ------------------------------------------------------------ # opttoken() - Return the next token from the Lexer # # Note: This function has been carefully implemented to be as fast # as possible. Don't make changes unless you really know what # you are doing # ------------------------------------------------------------ def token(self): # Make local copies of frequently referenced attributes lexpos = self.lexpos lexlen = self.lexlen lexignore = self.lexignore lexdata = self.lexdata while lexpos < lexlen: # This code provides some short-circuit code for whitespace, tabs, and other ignored characters if lexdata[lexpos] in lexignore: lexpos += 1 continue # Look for a regular expression match for lexre, lexindexfunc in self.lexre: m = lexre.match(lexdata, lexpos) if not m: continue # Create a token for return tok = LexToken() tok.value = m.group() tok.lineno = self.lineno tok.lexpos = lexpos i = m.lastindex func, tok.type = lexindexfunc[i] if not func: # If no token type was set, it's an ignored token if tok.type: self.lexpos = m.end() return tok else: lexpos = m.end() break lexpos = m.end() # If token is processed by a function, call it tok.lexer = self # Set additional attributes useful in token rules self.lexmatch = m self.lexpos = lexpos newtok = func(tok) # Every function must return a token, if nothing, we just move to next token if not newtok: lexpos = self.lexpos # This is here in case user has updated lexpos. lexignore = self.lexignore # This is here in case there was a state change break # Verify type of the token. If not in the token map, raise an error if not self.lexoptimize: if newtok.type not in self.lextokens_all: raise LexError("%s:%d: Rule '%s' returned an unknown token type '%s'" % ( func.__code__.co_filename, func.__code__.co_firstlineno, func.__name__, newtok.type), lexdata[lexpos:]) return newtok else: # No match, see if in literals if lexdata[lexpos] in self.lexliterals: tok = LexToken() tok.value = lexdata[lexpos] tok.lineno = self.lineno tok.type = tok.value tok.lexpos = lexpos self.lexpos = lexpos + 1 return tok # No match. Call t_error() if defined. if self.lexerrorf: tok = LexToken() tok.value = self.lexdata[lexpos:] tok.lineno = self.lineno tok.type = 'error' tok.lexer = self tok.lexpos = lexpos self.lexpos = lexpos newtok = self.lexerrorf(tok) if lexpos == self.lexpos: # Error method didn't change text position at all. This is an error. raise LexError("Scanning error. Illegal character '%s'" % (lexdata[lexpos]), lexdata[lexpos:]) lexpos = self.lexpos if not newtok: continue return newtok self.lexpos = lexpos raise LexError("Illegal character '%s' at index %d" % (lexdata[lexpos], lexpos), lexdata[lexpos:]) if self.lexeoff: tok = LexToken() tok.type = 'eof' tok.value = '' tok.lineno = self.lineno tok.lexpos = lexpos tok.lexer = self self.lexpos = lexpos newtok = self.lexeoff(tok) return newtok self.lexpos = lexpos + 1 if self.lexdata is None: raise RuntimeError('No input string given with input()') return None # Iterator interface def __iter__(self): return self def next(self): t = self.token() if t is None: raise StopIteration return t __next__ = next # ----------------------------------------------------------------------------- # ==== Lex Builder === # # The functions and classes below are used to collect lexing information # and build a Lexer object from it. # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # _get_regex(func) # # Returns the regular expression assigned to a function either as a doc string # or as a .regex attribute attached by the @TOKEN decorator. # ----------------------------------------------------------------------------- def _get_regex(func): return getattr(func, 'regex', func.__doc__) # ----------------------------------------------------------------------------- # get_caller_module_dict() # # This function returns a dictionary containing all of the symbols defined within # a caller further down the call stack. This is used to get the environment # associated with the yacc() call if none was provided. # ----------------------------------------------------------------------------- def get_caller_module_dict(levels): f = sys._getframe(levels) ldict = f.f_globals.copy() if f.f_globals != f.f_locals: ldict.update(f.f_locals) return ldict # ----------------------------------------------------------------------------- # _funcs_to_names() # # Given a list of regular expression functions, this converts it to a list # suitable for output to a table file # ----------------------------------------------------------------------------- def _funcs_to_names(funclist, namelist): result = [] for f, name in zip(funclist, namelist): if f and f[0]: result.append((name, f[1])) else: result.append(f) return result # ----------------------------------------------------------------------------- # _names_to_funcs() # # Given a list of regular expression function names, this converts it back to # functions. # ----------------------------------------------------------------------------- def _names_to_funcs(namelist, fdict): result = [] for n in namelist: if n and n[0]: result.append((fdict[n[0]], n[1])) else: result.append(n) return result # ----------------------------------------------------------------------------- # _form_master_re() # # This function takes a list of all of the regex components and attempts to # form the master regular expression. Given limitations in the Python re # module, it may be necessary to break the master regex into separate expressions. # ----------------------------------------------------------------------------- def _form_master_re(relist, reflags, ldict, toknames): if not relist: return [] regex = '|'.join(relist) try: lexre = re.compile(regex, reflags) # Build the index to function map for the matching engine lexindexfunc = [None] * (max(lexre.groupindex.values()) + 1) lexindexnames = lexindexfunc[:] for f, i in lexre.groupindex.items(): handle = ldict.get(f, None) if type(handle) in (types.FunctionType, types.MethodType): lexindexfunc[i] = (handle, toknames[f]) lexindexnames[i] = f elif handle is not None: lexindexnames[i] = f if f.find('ignore_') > 0: lexindexfunc[i] = (None, None) else: lexindexfunc[i] = (None, toknames[f]) return [(lexre, lexindexfunc)], [regex], [lexindexnames] except Exception: m = int(len(relist)/2) if m == 0: m = 1 llist, lre, lnames = _form_master_re(relist[:m], reflags, ldict, toknames) rlist, rre, rnames = _form_master_re(relist[m:], reflags, ldict, toknames) return (llist+rlist), (lre+rre), (lnames+rnames) # ----------------------------------------------------------------------------- # def _statetoken(s,names) # # Given a declaration name s of the form "t_" and a dictionary whose keys are # state names, this function returns a tuple (states,tokenname) where states # is a tuple of state names and tokenname is the name of the token. For example, # calling this with s = "t_foo_bar_SPAM" might return (('foo','bar'),'SPAM') # ----------------------------------------------------------------------------- def _statetoken(s, names): nonstate = 1 parts = s.split('_') for i, part in enumerate(parts[1:], 1): if part not in names and part != 'ANY': break if i > 1: states = tuple(parts[1:i]) else: states = ('INITIAL',) if 'ANY' in states: states = tuple(names) tokenname = '_'.join(parts[i:]) return (states, tokenname) # ----------------------------------------------------------------------------- # LexerReflect() # # This class represents information needed to build a lexer as extracted from a # user's input file. # ----------------------------------------------------------------------------- class LexerReflect(object): def __init__(self, ldict, log=None, reflags=0): self.ldict = ldict self.error_func = None self.tokens = [] self.reflags = reflags self.stateinfo = {'INITIAL': 'inclusive'} self.modules = set() self.error = False self.log = PlyLogger(sys.stderr) if log is None else log # Get all of the basic information def get_all(self): self.get_tokens() self.get_literals() self.get_states() self.get_rules() # Validate all of the information def validate_all(self): self.validate_tokens() self.validate_literals() self.validate_rules() return self.error # Get the tokens map def get_tokens(self): tokens = self.ldict.get('tokens', None) if not tokens: self.log.error('No token list is defined') self.error = True return if not isinstance(tokens, (list, tuple)): self.log.error('tokens must be a list or tuple') self.error = True return if not tokens: self.log.error('tokens is empty') self.error = True return self.tokens = tokens # Validate the tokens def validate_tokens(self): terminals = {} for n in self.tokens: if not _is_identifier.match(n): self.log.error("Bad token name '%s'", n) self.error = True if n in terminals: self.log.warning("Token '%s' multiply defined", n) terminals[n] = 1 # Get the literals specifier def get_literals(self): self.literals = self.ldict.get('literals', '') if not self.literals: self.literals = '' # Validate literals def validate_literals(self): try: for c in self.literals: if not isinstance(c, StringTypes) or len(c) > 1: self.log.error('Invalid literal %s. Must be a single character', repr(c)) self.error = True except TypeError: self.log.error('Invalid literals specification. literals must be a sequence of characters') self.error = True def get_states(self): self.states = self.ldict.get('states', None) # Build statemap if self.states: if not isinstance(self.states, (tuple, list)): self.log.error('states must be defined as a tuple or list') self.error = True else: for s in self.states: if not isinstance(s, tuple) or len(s) != 2: self.log.error("Invalid state specifier %s. Must be a tuple (statename,'exclusive|inclusive')", repr(s)) self.error = True continue name, statetype = s if not isinstance(name, StringTypes): self.log.error('State name %s must be a string', repr(name)) self.error = True continue if not (statetype == 'inclusive' or statetype == 'exclusive'): self.log.error("State type for state %s must be 'inclusive' or 'exclusive'", name) self.error = True continue if name in self.stateinfo: self.log.error("State '%s' already defined", name) self.error = True continue self.stateinfo[name] = statetype # Get all of the symbols with a t_ prefix and sort them into various # categories (functions, strings, error functions, and ignore characters) def get_rules(self): tsymbols = [f for f in self.ldict if f[:2] == 't_'] # Now build up a list of functions and a list of strings self.toknames = {} # Mapping of symbols to token names self.funcsym = {} # Symbols defined as functions self.strsym = {} # Symbols defined as strings self.ignore = {} # Ignore strings by state self.errorf = {} # Error functions by state self.eoff = {} # EOF functions by state for s in self.stateinfo: self.funcsym[s] = [] self.strsym[s] = [] if len(tsymbols) == 0: self.log.error('No rules of the form t_rulename are defined') self.error = True return for f in tsymbols: t = self.ldict[f] states, tokname = _statetoken(f, self.stateinfo) self.toknames[f] = tokname if hasattr(t, '__call__'): if tokname == 'error': for s in states: self.errorf[s] = t elif tokname == 'eof': for s in states: self.eoff[s] = t elif tokname == 'ignore': line = t.__code__.co_firstlineno file = t.__code__.co_filename self.log.error("%s:%d: Rule '%s' must be defined as a string", file, line, t.__name__) self.error = True else: for s in states: self.funcsym[s].append((f, t)) elif isinstance(t, StringTypes): if tokname == 'ignore': for s in states: self.ignore[s] = t if '\\' in t: self.log.warning("%s contains a literal backslash '\\'", f) elif tokname == 'error': self.log.error("Rule '%s' must be defined as a function", f) self.error = True else: for s in states: self.strsym[s].append((f, t)) else: self.log.error('%s not defined as a function or string', f) self.error = True # Sort the functions by line number for f in self.funcsym.values(): f.sort(key=lambda x: x[1].__code__.co_firstlineno) # Sort the strings by regular expression length for s in self.strsym.values(): s.sort(key=lambda x: len(x[1]), reverse=True) # Validate all of the t_rules collected def validate_rules(self): for state in self.stateinfo: # Validate all rules defined by functions for fname, f in self.funcsym[state]: line = f.__code__.co_firstlineno file = f.__code__.co_filename module = inspect.getmodule(f) self.modules.add(module) tokname = self.toknames[fname] if isinstance(f, types.MethodType): reqargs = 2 else: reqargs = 1 nargs = f.__code__.co_argcount if nargs > reqargs: self.log.error("%s:%d: Rule '%s' has too many arguments", file, line, f.__name__) self.error = True continue if nargs < reqargs: self.log.error("%s:%d: Rule '%s' requires an argument", file, line, f.__name__) self.error = True continue if not _get_regex(f): self.log.error("%s:%d: No regular expression defined for rule '%s'", file, line, f.__name__) self.error = True continue try: c = re.compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags) if c.match(''): self.log.error("%s:%d: Regular expression for rule '%s' matches empty string", file, line, f.__name__) self.error = True except re.error as e: self.log.error("%s:%d: Invalid regular expression for rule '%s'. %s", file, line, f.__name__, e) if '#' in _get_regex(f): self.log.error("%s:%d. Make sure '#' in rule '%s' is escaped with '\\#'", file, line, f.__name__) self.error = True # Validate all rules defined by strings for name, r in self.strsym[state]: tokname = self.toknames[name] if tokname == 'error': self.log.error("Rule '%s' must be defined as a function", name) self.error = True continue if tokname not in self.tokens and tokname.find('ignore_') < 0: self.log.error("Rule '%s' defined for an unspecified token %s", name, tokname) self.error = True continue try: c = re.compile('(?P<%s>%s)' % (name, r), self.reflags) if (c.match('')): self.log.error("Regular expression for rule '%s' matches empty string", name) self.error = True except re.error as e: self.log.error("Invalid regular expression for rule '%s'. %s", name, e) if '#' in r: self.log.error("Make sure '#' in rule '%s' is escaped with '\\#'", name) self.error = True if not self.funcsym[state] and not self.strsym[state]: self.log.error("No rules defined for state '%s'", state) self.error = True # Validate the error function efunc = self.errorf.get(state, None) if efunc: f = efunc line = f.__code__.co_firstlineno file = f.__code__.co_filename module = inspect.getmodule(f) self.modules.add(module) if isinstance(f, types.MethodType): reqargs = 2 else: reqargs = 1 nargs = f.__code__.co_argcount if nargs > reqargs: self.log.error("%s:%d: Rule '%s' has too many arguments", file, line, f.__name__) self.error = True if nargs < reqargs: self.log.error("%s:%d: Rule '%s' requires an argument", file, line, f.__name__) self.error = True for module in self.modules: self.validate_module(module) # ----------------------------------------------------------------------------- # validate_module() # # This checks to see if there are duplicated t_rulename() functions or strings # in the parser input file. This is done using a simple regular expression # match on each line in the source code of the given module. # ----------------------------------------------------------------------------- def validate_module(self, module): try: lines, linen = inspect.getsourcelines(module) except IOError: return fre = re.compile(r'\s*def\s+(t_[a-zA-Z_0-9]*)\(') sre = re.compile(r'\s*(t_[a-zA-Z_0-9]*)\s*=') counthash = {} linen += 1 for line in lines: m = fre.match(line) if not m: m = sre.match(line) if m: name = m.group(1) prev = counthash.get(name) if not prev: counthash[name] = linen else: filename = inspect.getsourcefile(module) self.log.error('%s:%d: Rule %s redefined. Previously defined on line %d', filename, linen, name, prev) self.error = True linen += 1 # ----------------------------------------------------------------------------- # lex(module) # # Build all of the regular expression rules from definitions in the supplied module # ----------------------------------------------------------------------------- def lex(module=None, object=None, debug=False, optimize=False, lextab='lextab', reflags=int(re.VERBOSE), nowarn=False, outputdir=None, debuglog=None, errorlog=None): if lextab is None: lextab = 'lextab' global lexer ldict = None stateinfo = {'INITIAL': 'inclusive'} lexobj = Lexer() lexobj.lexoptimize = optimize global token, input if errorlog is None: errorlog = PlyLogger(sys.stderr) if debug: if debuglog is None: debuglog = PlyLogger(sys.stderr) # Get the module dictionary used for the lexer if object: module = object # Get the module dictionary used for the parser if module: _items = [(k, getattr(module, k)) for k in dir(module)] ldict = dict(_items) # If no __file__ attribute is available, try to obtain it from the __module__ instead if '__file__' not in ldict: ldict['__file__'] = sys.modules[ldict['__module__']].__file__ else: ldict = get_caller_module_dict(2) # Determine if the module is package of a package or not. # If so, fix the tabmodule setting so that tables load correctly pkg = ldict.get('__package__') if pkg and isinstance(lextab, str): if '.' not in lextab: lextab = pkg + '.' + lextab # Collect parser information from the dictionary linfo = LexerReflect(ldict, log=errorlog, reflags=reflags) linfo.get_all() if not optimize: if linfo.validate_all(): raise SyntaxError("Can't build lexer") if optimize and lextab: try: lexobj.readtab(lextab, ldict) token = lexobj.token input = lexobj.input lexer = lexobj return lexobj except ImportError: pass # Dump some basic debugging information if debug: debuglog.info('lex: tokens = %r', linfo.tokens) debuglog.info('lex: literals = %r', linfo.literals) debuglog.info('lex: states = %r', linfo.stateinfo) # Build a dictionary of valid token names lexobj.lextokens = set() for n in linfo.tokens: lexobj.lextokens.add(n) # Get literals specification if isinstance(linfo.literals, (list, tuple)): lexobj.lexliterals = type(linfo.literals[0])().join(linfo.literals) else: lexobj.lexliterals = linfo.literals lexobj.lextokens_all = lexobj.lextokens | set(lexobj.lexliterals) # Get the stateinfo dictionary stateinfo = linfo.stateinfo regexs = {} # Build the master regular expressions for state in stateinfo: regex_list = [] # Add rules defined by functions first for fname, f in linfo.funcsym[state]: line = f.__code__.co_firstlineno file = f.__code__.co_filename regex_list.append('(?P<%s>%s)' % (fname, _get_regex(f))) if debug: debuglog.info("lex: Adding rule %s -> '%s' (state '%s')", fname, _get_regex(f), state) # Now add all of the simple rules for name, r in linfo.strsym[state]: regex_list.append('(?P<%s>%s)' % (name, r)) if debug: debuglog.info("lex: Adding rule %s -> '%s' (state '%s')", name, r, state) regexs[state] = regex_list # Build the master regular expressions if debug: debuglog.info('lex: ==== MASTER REGEXS FOLLOW ====') for state in regexs: lexre, re_text, re_names = _form_master_re(regexs[state], reflags, ldict, linfo.toknames) lexobj.lexstatere[state] = lexre lexobj.lexstateretext[state] = re_text lexobj.lexstaterenames[state] = re_names if debug: for i, text in enumerate(re_text): debuglog.info("lex: state '%s' : regex[%d] = '%s'", state, i, text) # For inclusive states, we need to add the regular expressions from the INITIAL state for state, stype in stateinfo.items(): if state != 'INITIAL' and stype == 'inclusive': lexobj.lexstatere[state].extend(lexobj.lexstatere['INITIAL']) lexobj.lexstateretext[state].extend(lexobj.lexstateretext['INITIAL']) lexobj.lexstaterenames[state].extend(lexobj.lexstaterenames['INITIAL']) lexobj.lexstateinfo = stateinfo lexobj.lexre = lexobj.lexstatere['INITIAL'] lexobj.lexretext = lexobj.lexstateretext['INITIAL'] lexobj.lexreflags = reflags # Set up ignore variables lexobj.lexstateignore = linfo.ignore lexobj.lexignore = lexobj.lexstateignore.get('INITIAL', '') # Set up error functions lexobj.lexstateerrorf = linfo.errorf lexobj.lexerrorf = linfo.errorf.get('INITIAL', None) if not lexobj.lexerrorf: errorlog.warning('No t_error rule is defined') # Set up eof functions lexobj.lexstateeoff = linfo.eoff lexobj.lexeoff = linfo.eoff.get('INITIAL', None) # Check state information for ignore and error rules for s, stype in stateinfo.items(): if stype == 'exclusive': if s not in linfo.errorf: errorlog.warning("No error rule is defined for exclusive state '%s'", s) if s not in linfo.ignore and lexobj.lexignore: errorlog.warning("No ignore rule is defined for exclusive state '%s'", s) elif stype == 'inclusive': if s not in linfo.errorf: linfo.errorf[s] = linfo.errorf.get('INITIAL', None) if s not in linfo.ignore: linfo.ignore[s] = linfo.ignore.get('INITIAL', '') # Create global versions of the token() and input() functions token = lexobj.token input = lexobj.input lexer = lexobj # If in optimize mode, we write the lextab if lextab and optimize: if outputdir is None: # If no output directory is set, the location of the output files # is determined according to the following rules: # - If lextab specifies a package, files go into that package directory # - Otherwise, files go in the same directory as the specifying module if isinstance(lextab, types.ModuleType): srcfile = lextab.__file__ else: if '.' not in lextab: srcfile = ldict['__file__'] else: parts = lextab.split('.') pkgname = '.'.join(parts[:-1]) exec('import %s' % pkgname) srcfile = getattr(sys.modules[pkgname], '__file__', '') outputdir = os.path.dirname(srcfile) try: lexobj.writetab(lextab, outputdir) except IOError as e: errorlog.warning("Couldn't write lextab module %r. %s" % (lextab, e)) return lexobj # ----------------------------------------------------------------------------- # runmain() # # This runs the lexer as a main program # ----------------------------------------------------------------------------- def runmain(lexer=None, data=None): if not data: try: filename = sys.argv[1] f = open(filename) data = f.read() f.close() except IndexError: sys.stdout.write('Reading from standard input (type EOF to end):\n') data = sys.stdin.read() if lexer: _input = lexer.input else: _input = input _input(data) if lexer: _token = lexer.token else: _token = token while True: tok = _token() if not tok: break sys.stdout.write('(%s,%r,%d,%d)\n' % (tok.type, tok.value, tok.lineno, tok.lexpos)) # ----------------------------------------------------------------------------- # @TOKEN(regex) # # This decorator function can be used to set the regex expression on a function # when its docstring might need to be set in an alternative way # ----------------------------------------------------------------------------- def TOKEN(r): def set_regex(f): if hasattr(r, '__call__'): f.regex = _get_regex(r) else: f.regex = r return f return set_regex # Alternative spelling of the TOKEN decorator Token = TOKEN ply/yacc.py000064400000414153147205113120006645 0ustar00# ----------------------------------------------------------------------------- # ply: yacc.py # # Copyright (C) 2001-2017 # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # * Neither the name of the David Beazley or Dabeaz LLC may be used to # endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ----------------------------------------------------------------------------- # # This implements an LR parser that is constructed from grammar rules defined # as Python functions. The grammer is specified by supplying the BNF inside # Python documentation strings. The inspiration for this technique was borrowed # from John Aycock's Spark parsing system. PLY might be viewed as cross between # Spark and the GNU bison utility. # # The current implementation is only somewhat object-oriented. The # LR parser itself is defined in terms of an object (which allows multiple # parsers to co-exist). However, most of the variables used during table # construction are defined in terms of global variables. Users shouldn't # notice unless they are trying to define multiple parsers at the same # time using threads (in which case they should have their head examined). # # This implementation supports both SLR and LALR(1) parsing. LALR(1) # support was originally implemented by Elias Ioup (ezioup@alumni.uchicago.edu), # using the algorithm found in Aho, Sethi, and Ullman "Compilers: Principles, # Techniques, and Tools" (The Dragon Book). LALR(1) has since been replaced # by the more efficient DeRemer and Pennello algorithm. # # :::::::: WARNING ::::::: # # Construction of LR parsing tables is fairly complicated and expensive. # To make this module run fast, a *LOT* of work has been put into # optimization---often at the expensive of readability and what might # consider to be good Python "coding style." Modify the code at your # own risk! # ---------------------------------------------------------------------------- import re import types import sys import os.path import inspect import base64 import warnings __version__ = '3.10' __tabversion__ = '3.10' #----------------------------------------------------------------------------- # === User configurable parameters === # # Change these to modify the default behavior of yacc (if you wish) #----------------------------------------------------------------------------- yaccdebug = True # Debugging mode. If set, yacc generates a # a 'parser.out' file in the current directory debug_file = 'parser.out' # Default name of the debugging file tab_module = 'parsetab' # Default name of the table module default_lr = 'LALR' # Default LR table generation method error_count = 3 # Number of symbols that must be shifted to leave recovery mode yaccdevel = False # Set to True if developing yacc. This turns off optimized # implementations of certain functions. resultlimit = 40 # Size limit of results when running in debug mode. pickle_protocol = 0 # Protocol to use when writing pickle files # String type-checking compatibility if sys.version_info[0] < 3: string_types = basestring else: string_types = str MAXINT = sys.maxsize # This object is a stand-in for a logging object created by the # logging module. PLY will use this by default to create things # such as the parser.out file. If a user wants more detailed # information, they can create their own logging object and pass # it into PLY. class PlyLogger(object): def __init__(self, f): self.f = f def debug(self, msg, *args, **kwargs): self.f.write((msg % args) + '\n') info = debug def warning(self, msg, *args, **kwargs): self.f.write('WARNING: ' + (msg % args) + '\n') def error(self, msg, *args, **kwargs): self.f.write('ERROR: ' + (msg % args) + '\n') critical = debug # Null logger is used when no output is generated. Does nothing. class NullLogger(object): def __getattribute__(self, name): return self def __call__(self, *args, **kwargs): return self # Exception raised for yacc-related errors class YaccError(Exception): pass # Format the result message that the parser produces when running in debug mode. def format_result(r): repr_str = repr(r) if '\n' in repr_str: repr_str = repr(repr_str) if len(repr_str) > resultlimit: repr_str = repr_str[:resultlimit] + ' ...' result = '<%s @ 0x%x> (%s)' % (type(r).__name__, id(r), repr_str) return result # Format stack entries when the parser is running in debug mode def format_stack_entry(r): repr_str = repr(r) if '\n' in repr_str: repr_str = repr(repr_str) if len(repr_str) < 16: return repr_str else: return '<%s @ 0x%x>' % (type(r).__name__, id(r)) # Panic mode error recovery support. This feature is being reworked--much of the # code here is to offer a deprecation/backwards compatible transition _errok = None _token = None _restart = None _warnmsg = '''PLY: Don't use global functions errok(), token(), and restart() in p_error(). Instead, invoke the methods on the associated parser instance: def p_error(p): ... # Use parser.errok(), parser.token(), parser.restart() ... parser = yacc.yacc() ''' def errok(): warnings.warn(_warnmsg) return _errok() def restart(): warnings.warn(_warnmsg) return _restart() def token(): warnings.warn(_warnmsg) return _token() # Utility function to call the p_error() function with some deprecation hacks def call_errorfunc(errorfunc, token, parser): global _errok, _token, _restart _errok = parser.errok _token = parser.token _restart = parser.restart r = errorfunc(token) try: del _errok, _token, _restart except NameError: pass return r #----------------------------------------------------------------------------- # === LR Parsing Engine === # # The following classes are used for the LR parser itself. These are not # used during table construction and are independent of the actual LR # table generation algorithm #----------------------------------------------------------------------------- # This class is used to hold non-terminal grammar symbols during parsing. # It normally has the following attributes set: # .type = Grammar symbol type # .value = Symbol value # .lineno = Starting line number # .endlineno = Ending line number (optional, set automatically) # .lexpos = Starting lex position # .endlexpos = Ending lex position (optional, set automatically) class YaccSymbol: def __str__(self): return self.type def __repr__(self): return str(self) # This class is a wrapper around the objects actually passed to each # grammar rule. Index lookup and assignment actually assign the # .value attribute of the underlying YaccSymbol object. # The lineno() method returns the line number of a given # item (or 0 if not defined). The linespan() method returns # a tuple of (startline,endline) representing the range of lines # for a symbol. The lexspan() method returns a tuple (lexpos,endlexpos) # representing the range of positional information for a symbol. class YaccProduction: def __init__(self, s, stack=None): self.slice = s self.stack = stack self.lexer = None self.parser = None def __getitem__(self, n): if isinstance(n, slice): return [s.value for s in self.slice[n]] elif n >= 0: return self.slice[n].value else: return self.stack[n].value def __setitem__(self, n, v): self.slice[n].value = v def __getslice__(self, i, j): return [s.value for s in self.slice[i:j]] def __len__(self): return len(self.slice) def lineno(self, n): return getattr(self.slice[n], 'lineno', 0) def set_lineno(self, n, lineno): self.slice[n].lineno = lineno def linespan(self, n): startline = getattr(self.slice[n], 'lineno', 0) endline = getattr(self.slice[n], 'endlineno', startline) return startline, endline def lexpos(self, n): return getattr(self.slice[n], 'lexpos', 0) def lexspan(self, n): startpos = getattr(self.slice[n], 'lexpos', 0) endpos = getattr(self.slice[n], 'endlexpos', startpos) return startpos, endpos def error(self): raise SyntaxError # ----------------------------------------------------------------------------- # == LRParser == # # The LR Parsing engine. # ----------------------------------------------------------------------------- class LRParser: def __init__(self, lrtab, errorf): self.productions = lrtab.lr_productions self.action = lrtab.lr_action self.goto = lrtab.lr_goto self.errorfunc = errorf self.set_defaulted_states() self.errorok = True def errok(self): self.errorok = True def restart(self): del self.statestack[:] del self.symstack[:] sym = YaccSymbol() sym.type = '$end' self.symstack.append(sym) self.statestack.append(0) # Defaulted state support. # This method identifies parser states where there is only one possible reduction action. # For such states, the parser can make a choose to make a rule reduction without consuming # the next look-ahead token. This delayed invocation of the tokenizer can be useful in # certain kinds of advanced parsing situations where the lexer and parser interact with # each other or change states (i.e., manipulation of scope, lexer states, etc.). # # See: https://www.gnu.org/software/bison/manual/html_node/Default-Reductions.html#Default-Reductions def set_defaulted_states(self): self.defaulted_states = {} for state, actions in self.action.items(): rules = list(actions.values()) if len(rules) == 1 and rules[0] < 0: self.defaulted_states[state] = rules[0] def disable_defaulted_states(self): self.defaulted_states = {} def parse(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): if debug or yaccdevel: if isinstance(debug, int): debug = PlyLogger(sys.stderr) return self.parsedebug(input, lexer, debug, tracking, tokenfunc) elif tracking: return self.parseopt(input, lexer, debug, tracking, tokenfunc) else: return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc) # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # parsedebug(). # # This is the debugging enabled version of parse(). All changes made to the # parsing engine should be made here. Optimized versions of this function # are automatically created by the ply/ygen.py script. This script cuts out # sections enclosed in markers such as this: # # #--! DEBUG # statements # #--! DEBUG # # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! def parsedebug(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): #--! parsedebug-start lookahead = None # Current lookahead symbol lookaheadstack = [] # Stack of lookahead symbols actions = self.action # Local reference to action table (to avoid lookup on self.) goto = self.goto # Local reference to goto table (to avoid lookup on self.) prod = self.productions # Local reference to production list (to avoid lookup on self.) defaulted_states = self.defaulted_states # Local reference to defaulted states pslice = YaccProduction(None) # Production object passed to grammar rules errorcount = 0 # Used during error recovery #--! DEBUG debug.info('PLY: PARSE DEBUG START') #--! DEBUG # If no lexer was given, we will try to use the lex module if not lexer: from . import lex lexer = lex.lexer # Set up the lexer and parser objects on pslice pslice.lexer = lexer pslice.parser = self # If input was supplied, pass to lexer if input is not None: lexer.input(input) if tokenfunc is None: # Tokenize function get_token = lexer.token else: get_token = tokenfunc # Set the parser() token method (sometimes used in error recovery) self.token = get_token # Set up the state and symbol stacks statestack = [] # Stack of parsing states self.statestack = statestack symstack = [] # Stack of grammar symbols self.symstack = symstack pslice.stack = symstack # Put in the production errtoken = None # Err token # The start state is assumed to be (0,$end) statestack.append(0) sym = YaccSymbol() sym.type = '$end' symstack.append(sym) state = 0 while True: # Get the next symbol on the input. If a lookahead symbol # is already set, we just use that. Otherwise, we'll pull # the next token off of the lookaheadstack or from the lexer #--! DEBUG debug.debug('') debug.debug('State : %s', state) #--! DEBUG if state not in defaulted_states: if not lookahead: if not lookaheadstack: lookahead = get_token() # Get the next token else: lookahead = lookaheadstack.pop() if not lookahead: lookahead = YaccSymbol() lookahead.type = '$end' # Check the action table ltype = lookahead.type t = actions[state].get(ltype) else: t = defaulted_states[state] #--! DEBUG debug.debug('Defaulted state %s: Reduce using %d', state, -t) #--! DEBUG #--! DEBUG debug.debug('Stack : %s', ('%s . %s' % (' '.join([xx.type for xx in symstack][1:]), str(lookahead))).lstrip()) #--! DEBUG if t is not None: if t > 0: # shift a symbol on the stack statestack.append(t) state = t #--! DEBUG debug.debug('Action : Shift and goto state %s', t) #--! DEBUG symstack.append(lookahead) lookahead = None # Decrease error count on successful shift if errorcount: errorcount -= 1 continue if t < 0: # reduce a symbol on the stack, emit a production p = prod[-t] pname = p.name plen = p.len # Get production function sym = YaccSymbol() sym.type = pname # Production name sym.value = None #--! DEBUG if plen: debug.info('Action : Reduce rule [%s] with %s and goto state %d', p.str, '['+','.join([format_stack_entry(_v.value) for _v in symstack[-plen:]])+']', goto[statestack[-1-plen]][pname]) else: debug.info('Action : Reduce rule [%s] with %s and goto state %d', p.str, [], goto[statestack[-1]][pname]) #--! DEBUG if plen: targ = symstack[-plen-1:] targ[0] = sym #--! TRACKING if tracking: t1 = targ[1] sym.lineno = t1.lineno sym.lexpos = t1.lexpos t1 = targ[-1] sym.endlineno = getattr(t1, 'endlineno', t1.lineno) sym.endlexpos = getattr(t1, 'endlexpos', t1.lexpos) #--! TRACKING # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # The code enclosed in this section is duplicated # below as a performance optimization. Make sure # changes get made in both locations. pslice.slice = targ try: # Call the grammar rule with our special slice object del symstack[-plen:] self.state = state p.callable(pslice) del statestack[-plen:] #--! DEBUG debug.info('Result : %s', format_result(pslice[0])) #--! DEBUG symstack.append(sym) state = goto[statestack[-1]][pname] statestack.append(state) except SyntaxError: # If an error was set. Enter error recovery state lookaheadstack.append(lookahead) # Save the current lookahead token symstack.extend(targ[1:-1]) # Put the production slice back on the stack statestack.pop() # Pop back one state (before the reduce) state = statestack[-1] sym.type = 'error' sym.value = 'error' lookahead = sym errorcount = error_count self.errorok = False continue # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! else: #--! TRACKING if tracking: sym.lineno = lexer.lineno sym.lexpos = lexer.lexpos #--! TRACKING targ = [sym] # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # The code enclosed in this section is duplicated # above as a performance optimization. Make sure # changes get made in both locations. pslice.slice = targ try: # Call the grammar rule with our special slice object self.state = state p.callable(pslice) #--! DEBUG debug.info('Result : %s', format_result(pslice[0])) #--! DEBUG symstack.append(sym) state = goto[statestack[-1]][pname] statestack.append(state) except SyntaxError: # If an error was set. Enter error recovery state lookaheadstack.append(lookahead) # Save the current lookahead token statestack.pop() # Pop back one state (before the reduce) state = statestack[-1] sym.type = 'error' sym.value = 'error' lookahead = sym errorcount = error_count self.errorok = False continue # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if t == 0: n = symstack[-1] result = getattr(n, 'value', None) #--! DEBUG debug.info('Done : Returning %s', format_result(result)) debug.info('PLY: PARSE DEBUG END') #--! DEBUG return result if t is None: #--! DEBUG debug.error('Error : %s', ('%s . %s' % (' '.join([xx.type for xx in symstack][1:]), str(lookahead))).lstrip()) #--! DEBUG # We have some kind of parsing error here. To handle # this, we are going to push the current token onto # the tokenstack and replace it with an 'error' token. # If there are any synchronization rules, they may # catch it. # # In addition to pushing the error token, we call call # the user defined p_error() function if this is the # first syntax error. This function is only called if # errorcount == 0. if errorcount == 0 or self.errorok: errorcount = error_count self.errorok = False errtoken = lookahead if errtoken.type == '$end': errtoken = None # End of file! if self.errorfunc: if errtoken and not hasattr(errtoken, 'lexer'): errtoken.lexer = lexer self.state = state tok = call_errorfunc(self.errorfunc, errtoken, self) if self.errorok: # User must have done some kind of panic # mode recovery on their own. The # returned token is the next lookahead lookahead = tok errtoken = None continue else: if errtoken: if hasattr(errtoken, 'lineno'): lineno = lookahead.lineno else: lineno = 0 if lineno: sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) else: sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) else: sys.stderr.write('yacc: Parse error in input. EOF\n') return else: errorcount = error_count # case 1: the statestack only has 1 entry on it. If we're in this state, the # entire parse has been rolled back and we're completely hosed. The token is # discarded and we just keep going. if len(statestack) <= 1 and lookahead.type != '$end': lookahead = None errtoken = None state = 0 # Nuke the pushback stack del lookaheadstack[:] continue # case 2: the statestack has a couple of entries on it, but we're # at the end of the file. nuke the top entry and generate an error token # Start nuking entries on the stack if lookahead.type == '$end': # Whoa. We're really hosed here. Bail out return if lookahead.type != 'error': sym = symstack[-1] if sym.type == 'error': # Hmmm. Error is on top of stack, we'll just nuke input # symbol and continue #--! TRACKING if tracking: sym.endlineno = getattr(lookahead, 'lineno', sym.lineno) sym.endlexpos = getattr(lookahead, 'lexpos', sym.lexpos) #--! TRACKING lookahead = None continue # Create the error symbol for the first time and make it the new lookahead symbol t = YaccSymbol() t.type = 'error' if hasattr(lookahead, 'lineno'): t.lineno = t.endlineno = lookahead.lineno if hasattr(lookahead, 'lexpos'): t.lexpos = t.endlexpos = lookahead.lexpos t.value = lookahead lookaheadstack.append(lookahead) lookahead = t else: sym = symstack.pop() #--! TRACKING if tracking: lookahead.lineno = sym.lineno lookahead.lexpos = sym.lexpos #--! TRACKING statestack.pop() state = statestack[-1] continue # Call an error function here raise RuntimeError('yacc: internal parser error!!!\n') #--! parsedebug-end # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # parseopt(). # # Optimized version of parse() method. DO NOT EDIT THIS CODE DIRECTLY! # This code is automatically generated by the ply/ygen.py script. Make # changes to the parsedebug() method instead. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! def parseopt(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): #--! parseopt-start lookahead = None # Current lookahead symbol lookaheadstack = [] # Stack of lookahead symbols actions = self.action # Local reference to action table (to avoid lookup on self.) goto = self.goto # Local reference to goto table (to avoid lookup on self.) prod = self.productions # Local reference to production list (to avoid lookup on self.) defaulted_states = self.defaulted_states # Local reference to defaulted states pslice = YaccProduction(None) # Production object passed to grammar rules errorcount = 0 # Used during error recovery # If no lexer was given, we will try to use the lex module if not lexer: from . import lex lexer = lex.lexer # Set up the lexer and parser objects on pslice pslice.lexer = lexer pslice.parser = self # If input was supplied, pass to lexer if input is not None: lexer.input(input) if tokenfunc is None: # Tokenize function get_token = lexer.token else: get_token = tokenfunc # Set the parser() token method (sometimes used in error recovery) self.token = get_token # Set up the state and symbol stacks statestack = [] # Stack of parsing states self.statestack = statestack symstack = [] # Stack of grammar symbols self.symstack = symstack pslice.stack = symstack # Put in the production errtoken = None # Err token # The start state is assumed to be (0,$end) statestack.append(0) sym = YaccSymbol() sym.type = '$end' symstack.append(sym) state = 0 while True: # Get the next symbol on the input. If a lookahead symbol # is already set, we just use that. Otherwise, we'll pull # the next token off of the lookaheadstack or from the lexer if state not in defaulted_states: if not lookahead: if not lookaheadstack: lookahead = get_token() # Get the next token else: lookahead = lookaheadstack.pop() if not lookahead: lookahead = YaccSymbol() lookahead.type = '$end' # Check the action table ltype = lookahead.type t = actions[state].get(ltype) else: t = defaulted_states[state] if t is not None: if t > 0: # shift a symbol on the stack statestack.append(t) state = t symstack.append(lookahead) lookahead = None # Decrease error count on successful shift if errorcount: errorcount -= 1 continue if t < 0: # reduce a symbol on the stack, emit a production p = prod[-t] pname = p.name plen = p.len # Get production function sym = YaccSymbol() sym.type = pname # Production name sym.value = None if plen: targ = symstack[-plen-1:] targ[0] = sym #--! TRACKING if tracking: t1 = targ[1] sym.lineno = t1.lineno sym.lexpos = t1.lexpos t1 = targ[-1] sym.endlineno = getattr(t1, 'endlineno', t1.lineno) sym.endlexpos = getattr(t1, 'endlexpos', t1.lexpos) #--! TRACKING # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # The code enclosed in this section is duplicated # below as a performance optimization. Make sure # changes get made in both locations. pslice.slice = targ try: # Call the grammar rule with our special slice object del symstack[-plen:] self.state = state p.callable(pslice) del statestack[-plen:] symstack.append(sym) state = goto[statestack[-1]][pname] statestack.append(state) except SyntaxError: # If an error was set. Enter error recovery state lookaheadstack.append(lookahead) # Save the current lookahead token symstack.extend(targ[1:-1]) # Put the production slice back on the stack statestack.pop() # Pop back one state (before the reduce) state = statestack[-1] sym.type = 'error' sym.value = 'error' lookahead = sym errorcount = error_count self.errorok = False continue # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! else: #--! TRACKING if tracking: sym.lineno = lexer.lineno sym.lexpos = lexer.lexpos #--! TRACKING targ = [sym] # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # The code enclosed in this section is duplicated # above as a performance optimization. Make sure # changes get made in both locations. pslice.slice = targ try: # Call the grammar rule with our special slice object self.state = state p.callable(pslice) symstack.append(sym) state = goto[statestack[-1]][pname] statestack.append(state) except SyntaxError: # If an error was set. Enter error recovery state lookaheadstack.append(lookahead) # Save the current lookahead token statestack.pop() # Pop back one state (before the reduce) state = statestack[-1] sym.type = 'error' sym.value = 'error' lookahead = sym errorcount = error_count self.errorok = False continue # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if t == 0: n = symstack[-1] result = getattr(n, 'value', None) return result if t is None: # We have some kind of parsing error here. To handle # this, we are going to push the current token onto # the tokenstack and replace it with an 'error' token. # If there are any synchronization rules, they may # catch it. # # In addition to pushing the error token, we call call # the user defined p_error() function if this is the # first syntax error. This function is only called if # errorcount == 0. if errorcount == 0 or self.errorok: errorcount = error_count self.errorok = False errtoken = lookahead if errtoken.type == '$end': errtoken = None # End of file! if self.errorfunc: if errtoken and not hasattr(errtoken, 'lexer'): errtoken.lexer = lexer self.state = state tok = call_errorfunc(self.errorfunc, errtoken, self) if self.errorok: # User must have done some kind of panic # mode recovery on their own. The # returned token is the next lookahead lookahead = tok errtoken = None continue else: if errtoken: if hasattr(errtoken, 'lineno'): lineno = lookahead.lineno else: lineno = 0 if lineno: sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) else: sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) else: sys.stderr.write('yacc: Parse error in input. EOF\n') return else: errorcount = error_count # case 1: the statestack only has 1 entry on it. If we're in this state, the # entire parse has been rolled back and we're completely hosed. The token is # discarded and we just keep going. if len(statestack) <= 1 and lookahead.type != '$end': lookahead = None errtoken = None state = 0 # Nuke the pushback stack del lookaheadstack[:] continue # case 2: the statestack has a couple of entries on it, but we're # at the end of the file. nuke the top entry and generate an error token # Start nuking entries on the stack if lookahead.type == '$end': # Whoa. We're really hosed here. Bail out return if lookahead.type != 'error': sym = symstack[-1] if sym.type == 'error': # Hmmm. Error is on top of stack, we'll just nuke input # symbol and continue #--! TRACKING if tracking: sym.endlineno = getattr(lookahead, 'lineno', sym.lineno) sym.endlexpos = getattr(lookahead, 'lexpos', sym.lexpos) #--! TRACKING lookahead = None continue # Create the error symbol for the first time and make it the new lookahead symbol t = YaccSymbol() t.type = 'error' if hasattr(lookahead, 'lineno'): t.lineno = t.endlineno = lookahead.lineno if hasattr(lookahead, 'lexpos'): t.lexpos = t.endlexpos = lookahead.lexpos t.value = lookahead lookaheadstack.append(lookahead) lookahead = t else: sym = symstack.pop() #--! TRACKING if tracking: lookahead.lineno = sym.lineno lookahead.lexpos = sym.lexpos #--! TRACKING statestack.pop() state = statestack[-1] continue # Call an error function here raise RuntimeError('yacc: internal parser error!!!\n') #--! parseopt-end # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # parseopt_notrack(). # # Optimized version of parseopt() with line number tracking removed. # DO NOT EDIT THIS CODE DIRECTLY. This code is automatically generated # by the ply/ygen.py script. Make changes to the parsedebug() method instead. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! def parseopt_notrack(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): #--! parseopt-notrack-start lookahead = None # Current lookahead symbol lookaheadstack = [] # Stack of lookahead symbols actions = self.action # Local reference to action table (to avoid lookup on self.) goto = self.goto # Local reference to goto table (to avoid lookup on self.) prod = self.productions # Local reference to production list (to avoid lookup on self.) defaulted_states = self.defaulted_states # Local reference to defaulted states pslice = YaccProduction(None) # Production object passed to grammar rules errorcount = 0 # Used during error recovery # If no lexer was given, we will try to use the lex module if not lexer: from . import lex lexer = lex.lexer # Set up the lexer and parser objects on pslice pslice.lexer = lexer pslice.parser = self # If input was supplied, pass to lexer if input is not None: lexer.input(input) if tokenfunc is None: # Tokenize function get_token = lexer.token else: get_token = tokenfunc # Set the parser() token method (sometimes used in error recovery) self.token = get_token # Set up the state and symbol stacks statestack = [] # Stack of parsing states self.statestack = statestack symstack = [] # Stack of grammar symbols self.symstack = symstack pslice.stack = symstack # Put in the production errtoken = None # Err token # The start state is assumed to be (0,$end) statestack.append(0) sym = YaccSymbol() sym.type = '$end' symstack.append(sym) state = 0 while True: # Get the next symbol on the input. If a lookahead symbol # is already set, we just use that. Otherwise, we'll pull # the next token off of the lookaheadstack or from the lexer if state not in defaulted_states: if not lookahead: if not lookaheadstack: lookahead = get_token() # Get the next token else: lookahead = lookaheadstack.pop() if not lookahead: lookahead = YaccSymbol() lookahead.type = '$end' # Check the action table ltype = lookahead.type t = actions[state].get(ltype) else: t = defaulted_states[state] if t is not None: if t > 0: # shift a symbol on the stack statestack.append(t) state = t symstack.append(lookahead) lookahead = None # Decrease error count on successful shift if errorcount: errorcount -= 1 continue if t < 0: # reduce a symbol on the stack, emit a production p = prod[-t] pname = p.name plen = p.len # Get production function sym = YaccSymbol() sym.type = pname # Production name sym.value = None if plen: targ = symstack[-plen-1:] targ[0] = sym # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # The code enclosed in this section is duplicated # below as a performance optimization. Make sure # changes get made in both locations. pslice.slice = targ try: # Call the grammar rule with our special slice object del symstack[-plen:] self.state = state p.callable(pslice) del statestack[-plen:] symstack.append(sym) state = goto[statestack[-1]][pname] statestack.append(state) except SyntaxError: # If an error was set. Enter error recovery state lookaheadstack.append(lookahead) # Save the current lookahead token symstack.extend(targ[1:-1]) # Put the production slice back on the stack statestack.pop() # Pop back one state (before the reduce) state = statestack[-1] sym.type = 'error' sym.value = 'error' lookahead = sym errorcount = error_count self.errorok = False continue # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! else: targ = [sym] # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # The code enclosed in this section is duplicated # above as a performance optimization. Make sure # changes get made in both locations. pslice.slice = targ try: # Call the grammar rule with our special slice object self.state = state p.callable(pslice) symstack.append(sym) state = goto[statestack[-1]][pname] statestack.append(state) except SyntaxError: # If an error was set. Enter error recovery state lookaheadstack.append(lookahead) # Save the current lookahead token statestack.pop() # Pop back one state (before the reduce) state = statestack[-1] sym.type = 'error' sym.value = 'error' lookahead = sym errorcount = error_count self.errorok = False continue # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if t == 0: n = symstack[-1] result = getattr(n, 'value', None) return result if t is None: # We have some kind of parsing error here. To handle # this, we are going to push the current token onto # the tokenstack and replace it with an 'error' token. # If there are any synchronization rules, they may # catch it. # # In addition to pushing the error token, we call call # the user defined p_error() function if this is the # first syntax error. This function is only called if # errorcount == 0. if errorcount == 0 or self.errorok: errorcount = error_count self.errorok = False errtoken = lookahead if errtoken.type == '$end': errtoken = None # End of file! if self.errorfunc: if errtoken and not hasattr(errtoken, 'lexer'): errtoken.lexer = lexer self.state = state tok = call_errorfunc(self.errorfunc, errtoken, self) if self.errorok: # User must have done some kind of panic # mode recovery on their own. The # returned token is the next lookahead lookahead = tok errtoken = None continue else: if errtoken: if hasattr(errtoken, 'lineno'): lineno = lookahead.lineno else: lineno = 0 if lineno: sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) else: sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) else: sys.stderr.write('yacc: Parse error in input. EOF\n') return else: errorcount = error_count # case 1: the statestack only has 1 entry on it. If we're in this state, the # entire parse has been rolled back and we're completely hosed. The token is # discarded and we just keep going. if len(statestack) <= 1 and lookahead.type != '$end': lookahead = None errtoken = None state = 0 # Nuke the pushback stack del lookaheadstack[:] continue # case 2: the statestack has a couple of entries on it, but we're # at the end of the file. nuke the top entry and generate an error token # Start nuking entries on the stack if lookahead.type == '$end': # Whoa. We're really hosed here. Bail out return if lookahead.type != 'error': sym = symstack[-1] if sym.type == 'error': # Hmmm. Error is on top of stack, we'll just nuke input # symbol and continue lookahead = None continue # Create the error symbol for the first time and make it the new lookahead symbol t = YaccSymbol() t.type = 'error' if hasattr(lookahead, 'lineno'): t.lineno = t.endlineno = lookahead.lineno if hasattr(lookahead, 'lexpos'): t.lexpos = t.endlexpos = lookahead.lexpos t.value = lookahead lookaheadstack.append(lookahead) lookahead = t else: sym = symstack.pop() statestack.pop() state = statestack[-1] continue # Call an error function here raise RuntimeError('yacc: internal parser error!!!\n') #--! parseopt-notrack-end # ----------------------------------------------------------------------------- # === Grammar Representation === # # The following functions, classes, and variables are used to represent and # manipulate the rules that make up a grammar. # ----------------------------------------------------------------------------- # regex matching identifiers _is_identifier = re.compile(r'^[a-zA-Z0-9_-]+$') # ----------------------------------------------------------------------------- # class Production: # # This class stores the raw information about a single production or grammar rule. # A grammar rule refers to a specification such as this: # # expr : expr PLUS term # # Here are the basic attributes defined on all productions # # name - Name of the production. For example 'expr' # prod - A list of symbols on the right side ['expr','PLUS','term'] # prec - Production precedence level # number - Production number. # func - Function that executes on reduce # file - File where production function is defined # lineno - Line number where production function is defined # # The following attributes are defined or optional. # # len - Length of the production (number of symbols on right hand side) # usyms - Set of unique symbols found in the production # ----------------------------------------------------------------------------- class Production(object): reduced = 0 def __init__(self, number, name, prod, precedence=('right', 0), func=None, file='', line=0): self.name = name self.prod = tuple(prod) self.number = number self.func = func self.callable = None self.file = file self.line = line self.prec = precedence # Internal settings used during table construction self.len = len(self.prod) # Length of the production # Create a list of unique production symbols used in the production self.usyms = [] for s in self.prod: if s not in self.usyms: self.usyms.append(s) # List of all LR items for the production self.lr_items = [] self.lr_next = None # Create a string representation if self.prod: self.str = '%s -> %s' % (self.name, ' '.join(self.prod)) else: self.str = '%s -> ' % self.name def __str__(self): return self.str def __repr__(self): return 'Production(' + str(self) + ')' def __len__(self): return len(self.prod) def __nonzero__(self): return 1 def __getitem__(self, index): return self.prod[index] # Return the nth lr_item from the production (or None if at the end) def lr_item(self, n): if n > len(self.prod): return None p = LRItem(self, n) # Precompute the list of productions immediately following. try: p.lr_after = Prodnames[p.prod[n+1]] except (IndexError, KeyError): p.lr_after = [] try: p.lr_before = p.prod[n-1] except IndexError: p.lr_before = None return p # Bind the production function name to a callable def bind(self, pdict): if self.func: self.callable = pdict[self.func] # This class serves as a minimal standin for Production objects when # reading table data from files. It only contains information # actually used by the LR parsing engine, plus some additional # debugging information. class MiniProduction(object): def __init__(self, str, name, len, func, file, line): self.name = name self.len = len self.func = func self.callable = None self.file = file self.line = line self.str = str def __str__(self): return self.str def __repr__(self): return 'MiniProduction(%s)' % self.str # Bind the production function name to a callable def bind(self, pdict): if self.func: self.callable = pdict[self.func] # ----------------------------------------------------------------------------- # class LRItem # # This class represents a specific stage of parsing a production rule. For # example: # # expr : expr . PLUS term # # In the above, the "." represents the current location of the parse. Here # basic attributes: # # name - Name of the production. For example 'expr' # prod - A list of symbols on the right side ['expr','.', 'PLUS','term'] # number - Production number. # # lr_next Next LR item. Example, if we are ' expr -> expr . PLUS term' # then lr_next refers to 'expr -> expr PLUS . term' # lr_index - LR item index (location of the ".") in the prod list. # lookaheads - LALR lookahead symbols for this item # len - Length of the production (number of symbols on right hand side) # lr_after - List of all productions that immediately follow # lr_before - Grammar symbol immediately before # ----------------------------------------------------------------------------- class LRItem(object): def __init__(self, p, n): self.name = p.name self.prod = list(p.prod) self.number = p.number self.lr_index = n self.lookaheads = {} self.prod.insert(n, '.') self.prod = tuple(self.prod) self.len = len(self.prod) self.usyms = p.usyms def __str__(self): if self.prod: s = '%s -> %s' % (self.name, ' '.join(self.prod)) else: s = '%s -> ' % self.name return s def __repr__(self): return 'LRItem(' + str(self) + ')' # ----------------------------------------------------------------------------- # rightmost_terminal() # # Return the rightmost terminal from a list of symbols. Used in add_production() # ----------------------------------------------------------------------------- def rightmost_terminal(symbols, terminals): i = len(symbols) - 1 while i >= 0: if symbols[i] in terminals: return symbols[i] i -= 1 return None # ----------------------------------------------------------------------------- # === GRAMMAR CLASS === # # The following class represents the contents of the specified grammar along # with various computed properties such as first sets, follow sets, LR items, etc. # This data is used for critical parts of the table generation process later. # ----------------------------------------------------------------------------- class GrammarError(YaccError): pass class Grammar(object): def __init__(self, terminals): self.Productions = [None] # A list of all of the productions. The first # entry is always reserved for the purpose of # building an augmented grammar self.Prodnames = {} # A dictionary mapping the names of nonterminals to a list of all # productions of that nonterminal. self.Prodmap = {} # A dictionary that is only used to detect duplicate # productions. self.Terminals = {} # A dictionary mapping the names of terminal symbols to a # list of the rules where they are used. for term in terminals: self.Terminals[term] = [] self.Terminals['error'] = [] self.Nonterminals = {} # A dictionary mapping names of nonterminals to a list # of rule numbers where they are used. self.First = {} # A dictionary of precomputed FIRST(x) symbols self.Follow = {} # A dictionary of precomputed FOLLOW(x) symbols self.Precedence = {} # Precedence rules for each terminal. Contains tuples of the # form ('right',level) or ('nonassoc', level) or ('left',level) self.UsedPrecedence = set() # Precedence rules that were actually used by the grammer. # This is only used to provide error checking and to generate # a warning about unused precedence rules. self.Start = None # Starting symbol for the grammar def __len__(self): return len(self.Productions) def __getitem__(self, index): return self.Productions[index] # ----------------------------------------------------------------------------- # set_precedence() # # Sets the precedence for a given terminal. assoc is the associativity such as # 'left','right', or 'nonassoc'. level is a numeric level. # # ----------------------------------------------------------------------------- def set_precedence(self, term, assoc, level): assert self.Productions == [None], 'Must call set_precedence() before add_production()' if term in self.Precedence: raise GrammarError('Precedence already specified for terminal %r' % term) if assoc not in ['left', 'right', 'nonassoc']: raise GrammarError("Associativity must be one of 'left','right', or 'nonassoc'") self.Precedence[term] = (assoc, level) # ----------------------------------------------------------------------------- # add_production() # # Given an action function, this function assembles a production rule and # computes its precedence level. # # The production rule is supplied as a list of symbols. For example, # a rule such as 'expr : expr PLUS term' has a production name of 'expr' and # symbols ['expr','PLUS','term']. # # Precedence is determined by the precedence of the right-most non-terminal # or the precedence of a terminal specified by %prec. # # A variety of error checks are performed to make sure production symbols # are valid and that %prec is used correctly. # ----------------------------------------------------------------------------- def add_production(self, prodname, syms, func=None, file='', line=0): if prodname in self.Terminals: raise GrammarError('%s:%d: Illegal rule name %r. Already defined as a token' % (file, line, prodname)) if prodname == 'error': raise GrammarError('%s:%d: Illegal rule name %r. error is a reserved word' % (file, line, prodname)) if not _is_identifier.match(prodname): raise GrammarError('%s:%d: Illegal rule name %r' % (file, line, prodname)) # Look for literal tokens for n, s in enumerate(syms): if s[0] in "'\"": try: c = eval(s) if (len(c) > 1): raise GrammarError('%s:%d: Literal token %s in rule %r may only be a single character' % (file, line, s, prodname)) if c not in self.Terminals: self.Terminals[c] = [] syms[n] = c continue except SyntaxError: pass if not _is_identifier.match(s) and s != '%prec': raise GrammarError('%s:%d: Illegal name %r in rule %r' % (file, line, s, prodname)) # Determine the precedence level if '%prec' in syms: if syms[-1] == '%prec': raise GrammarError('%s:%d: Syntax error. Nothing follows %%prec' % (file, line)) if syms[-2] != '%prec': raise GrammarError('%s:%d: Syntax error. %%prec can only appear at the end of a grammar rule' % (file, line)) precname = syms[-1] prodprec = self.Precedence.get(precname) if not prodprec: raise GrammarError('%s:%d: Nothing known about the precedence of %r' % (file, line, precname)) else: self.UsedPrecedence.add(precname) del syms[-2:] # Drop %prec from the rule else: # If no %prec, precedence is determined by the rightmost terminal symbol precname = rightmost_terminal(syms, self.Terminals) prodprec = self.Precedence.get(precname, ('right', 0)) # See if the rule is already in the rulemap map = '%s -> %s' % (prodname, syms) if map in self.Prodmap: m = self.Prodmap[map] raise GrammarError('%s:%d: Duplicate rule %s. ' % (file, line, m) + 'Previous definition at %s:%d' % (m.file, m.line)) # From this point on, everything is valid. Create a new Production instance pnumber = len(self.Productions) if prodname not in self.Nonterminals: self.Nonterminals[prodname] = [] # Add the production number to Terminals and Nonterminals for t in syms: if t in self.Terminals: self.Terminals[t].append(pnumber) else: if t not in self.Nonterminals: self.Nonterminals[t] = [] self.Nonterminals[t].append(pnumber) # Create a production and add it to the list of productions p = Production(pnumber, prodname, syms, prodprec, func, file, line) self.Productions.append(p) self.Prodmap[map] = p # Add to the global productions list try: self.Prodnames[prodname].append(p) except KeyError: self.Prodnames[prodname] = [p] # ----------------------------------------------------------------------------- # set_start() # # Sets the starting symbol and creates the augmented grammar. Production # rule 0 is S' -> start where start is the start symbol. # ----------------------------------------------------------------------------- def set_start(self, start=None): if not start: start = self.Productions[1].name if start not in self.Nonterminals: raise GrammarError('start symbol %s undefined' % start) self.Productions[0] = Production(0, "S'", [start]) self.Nonterminals[start].append(0) self.Start = start # ----------------------------------------------------------------------------- # find_unreachable() # # Find all of the nonterminal symbols that can't be reached from the starting # symbol. Returns a list of nonterminals that can't be reached. # ----------------------------------------------------------------------------- def find_unreachable(self): # Mark all symbols that are reachable from a symbol s def mark_reachable_from(s): if s in reachable: return reachable.add(s) for p in self.Prodnames.get(s, []): for r in p.prod: mark_reachable_from(r) reachable = set() mark_reachable_from(self.Productions[0].prod[0]) return [s for s in self.Nonterminals if s not in reachable] # ----------------------------------------------------------------------------- # infinite_cycles() # # This function looks at the various parsing rules and tries to detect # infinite recursion cycles (grammar rules where there is no possible way # to derive a string of only terminals). # ----------------------------------------------------------------------------- def infinite_cycles(self): terminates = {} # Terminals: for t in self.Terminals: terminates[t] = True terminates['$end'] = True # Nonterminals: # Initialize to false: for n in self.Nonterminals: terminates[n] = False # Then propagate termination until no change: while True: some_change = False for (n, pl) in self.Prodnames.items(): # Nonterminal n terminates iff any of its productions terminates. for p in pl: # Production p terminates iff all of its rhs symbols terminate. for s in p.prod: if not terminates[s]: # The symbol s does not terminate, # so production p does not terminate. p_terminates = False break else: # didn't break from the loop, # so every symbol s terminates # so production p terminates. p_terminates = True if p_terminates: # symbol n terminates! if not terminates[n]: terminates[n] = True some_change = True # Don't need to consider any more productions for this n. break if not some_change: break infinite = [] for (s, term) in terminates.items(): if not term: if s not in self.Prodnames and s not in self.Terminals and s != 'error': # s is used-but-not-defined, and we've already warned of that, # so it would be overkill to say that it's also non-terminating. pass else: infinite.append(s) return infinite # ----------------------------------------------------------------------------- # undefined_symbols() # # Find all symbols that were used the grammar, but not defined as tokens or # grammar rules. Returns a list of tuples (sym, prod) where sym in the symbol # and prod is the production where the symbol was used. # ----------------------------------------------------------------------------- def undefined_symbols(self): result = [] for p in self.Productions: if not p: continue for s in p.prod: if s not in self.Prodnames and s not in self.Terminals and s != 'error': result.append((s, p)) return result # ----------------------------------------------------------------------------- # unused_terminals() # # Find all terminals that were defined, but not used by the grammar. Returns # a list of all symbols. # ----------------------------------------------------------------------------- def unused_terminals(self): unused_tok = [] for s, v in self.Terminals.items(): if s != 'error' and not v: unused_tok.append(s) return unused_tok # ------------------------------------------------------------------------------ # unused_rules() # # Find all grammar rules that were defined, but not used (maybe not reachable) # Returns a list of productions. # ------------------------------------------------------------------------------ def unused_rules(self): unused_prod = [] for s, v in self.Nonterminals.items(): if not v: p = self.Prodnames[s][0] unused_prod.append(p) return unused_prod # ----------------------------------------------------------------------------- # unused_precedence() # # Returns a list of tuples (term,precedence) corresponding to precedence # rules that were never used by the grammar. term is the name of the terminal # on which precedence was applied and precedence is a string such as 'left' or # 'right' corresponding to the type of precedence. # ----------------------------------------------------------------------------- def unused_precedence(self): unused = [] for termname in self.Precedence: if not (termname in self.Terminals or termname in self.UsedPrecedence): unused.append((termname, self.Precedence[termname][0])) return unused # ------------------------------------------------------------------------- # _first() # # Compute the value of FIRST1(beta) where beta is a tuple of symbols. # # During execution of compute_first1, the result may be incomplete. # Afterward (e.g., when called from compute_follow()), it will be complete. # ------------------------------------------------------------------------- def _first(self, beta): # We are computing First(x1,x2,x3,...,xn) result = [] for x in beta: x_produces_empty = False # Add all the non- symbols of First[x] to the result. for f in self.First[x]: if f == '': x_produces_empty = True else: if f not in result: result.append(f) if x_produces_empty: # We have to consider the next x in beta, # i.e. stay in the loop. pass else: # We don't have to consider any further symbols in beta. break else: # There was no 'break' from the loop, # so x_produces_empty was true for all x in beta, # so beta produces empty as well. result.append('') return result # ------------------------------------------------------------------------- # compute_first() # # Compute the value of FIRST1(X) for all symbols # ------------------------------------------------------------------------- def compute_first(self): if self.First: return self.First # Terminals: for t in self.Terminals: self.First[t] = [t] self.First['$end'] = ['$end'] # Nonterminals: # Initialize to the empty set: for n in self.Nonterminals: self.First[n] = [] # Then propagate symbols until no change: while True: some_change = False for n in self.Nonterminals: for p in self.Prodnames[n]: for f in self._first(p.prod): if f not in self.First[n]: self.First[n].append(f) some_change = True if not some_change: break return self.First # --------------------------------------------------------------------- # compute_follow() # # Computes all of the follow sets for every non-terminal symbol. The # follow set is the set of all symbols that might follow a given # non-terminal. See the Dragon book, 2nd Ed. p. 189. # --------------------------------------------------------------------- def compute_follow(self, start=None): # If already computed, return the result if self.Follow: return self.Follow # If first sets not computed yet, do that first. if not self.First: self.compute_first() # Add '$end' to the follow list of the start symbol for k in self.Nonterminals: self.Follow[k] = [] if not start: start = self.Productions[1].name self.Follow[start] = ['$end'] while True: didadd = False for p in self.Productions[1:]: # Here is the production set for i, B in enumerate(p.prod): if B in self.Nonterminals: # Okay. We got a non-terminal in a production fst = self._first(p.prod[i+1:]) hasempty = False for f in fst: if f != '' and f not in self.Follow[B]: self.Follow[B].append(f) didadd = True if f == '': hasempty = True if hasempty or i == (len(p.prod)-1): # Add elements of follow(a) to follow(b) for f in self.Follow[p.name]: if f not in self.Follow[B]: self.Follow[B].append(f) didadd = True if not didadd: break return self.Follow # ----------------------------------------------------------------------------- # build_lritems() # # This function walks the list of productions and builds a complete set of the # LR items. The LR items are stored in two ways: First, they are uniquely # numbered and placed in the list _lritems. Second, a linked list of LR items # is built for each production. For example: # # E -> E PLUS E # # Creates the list # # [E -> . E PLUS E, E -> E . PLUS E, E -> E PLUS . E, E -> E PLUS E . ] # ----------------------------------------------------------------------------- def build_lritems(self): for p in self.Productions: lastlri = p i = 0 lr_items = [] while True: if i > len(p): lri = None else: lri = LRItem(p, i) # Precompute the list of productions immediately following try: lri.lr_after = self.Prodnames[lri.prod[i+1]] except (IndexError, KeyError): lri.lr_after = [] try: lri.lr_before = lri.prod[i-1] except IndexError: lri.lr_before = None lastlri.lr_next = lri if not lri: break lr_items.append(lri) lastlri = lri i += 1 p.lr_items = lr_items # ----------------------------------------------------------------------------- # == Class LRTable == # # This basic class represents a basic table of LR parsing information. # Methods for generating the tables are not defined here. They are defined # in the derived class LRGeneratedTable. # ----------------------------------------------------------------------------- class VersionError(YaccError): pass class LRTable(object): def __init__(self): self.lr_action = None self.lr_goto = None self.lr_productions = None self.lr_method = None def read_table(self, module): if isinstance(module, types.ModuleType): parsetab = module else: exec('import %s' % module) parsetab = sys.modules[module] if parsetab._tabversion != __tabversion__: raise VersionError('yacc table file version is out of date') self.lr_action = parsetab._lr_action self.lr_goto = parsetab._lr_goto self.lr_productions = [] for p in parsetab._lr_productions: self.lr_productions.append(MiniProduction(*p)) self.lr_method = parsetab._lr_method return parsetab._lr_signature def read_pickle(self, filename): try: import cPickle as pickle except ImportError: import pickle if not os.path.exists(filename): raise ImportError in_f = open(filename, 'rb') tabversion = pickle.load(in_f) if tabversion != __tabversion__: raise VersionError('yacc table file version is out of date') self.lr_method = pickle.load(in_f) signature = pickle.load(in_f) self.lr_action = pickle.load(in_f) self.lr_goto = pickle.load(in_f) productions = pickle.load(in_f) self.lr_productions = [] for p in productions: self.lr_productions.append(MiniProduction(*p)) in_f.close() return signature # Bind all production function names to callable objects in pdict def bind_callables(self, pdict): for p in self.lr_productions: p.bind(pdict) # ----------------------------------------------------------------------------- # === LR Generator === # # The following classes and functions are used to generate LR parsing tables on # a grammar. # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # digraph() # traverse() # # The following two functions are used to compute set valued functions # of the form: # # F(x) = F'(x) U U{F(y) | x R y} # # This is used to compute the values of Read() sets as well as FOLLOW sets # in LALR(1) generation. # # Inputs: X - An input set # R - A relation # FP - Set-valued function # ------------------------------------------------------------------------------ def digraph(X, R, FP): N = {} for x in X: N[x] = 0 stack = [] F = {} for x in X: if N[x] == 0: traverse(x, N, stack, F, X, R, FP) return F def traverse(x, N, stack, F, X, R, FP): stack.append(x) d = len(stack) N[x] = d F[x] = FP(x) # F(X) <- F'(x) rel = R(x) # Get y's related to x for y in rel: if N[y] == 0: traverse(y, N, stack, F, X, R, FP) N[x] = min(N[x], N[y]) for a in F.get(y, []): if a not in F[x]: F[x].append(a) if N[x] == d: N[stack[-1]] = MAXINT F[stack[-1]] = F[x] element = stack.pop() while element != x: N[stack[-1]] = MAXINT F[stack[-1]] = F[x] element = stack.pop() class LALRError(YaccError): pass # ----------------------------------------------------------------------------- # == LRGeneratedTable == # # This class implements the LR table generation algorithm. There are no # public methods except for write() # ----------------------------------------------------------------------------- class LRGeneratedTable(LRTable): def __init__(self, grammar, method='LALR', log=None): if method not in ['SLR', 'LALR']: raise LALRError('Unsupported method %s' % method) self.grammar = grammar self.lr_method = method # Set up the logger if not log: log = NullLogger() self.log = log # Internal attributes self.lr_action = {} # Action table self.lr_goto = {} # Goto table self.lr_productions = grammar.Productions # Copy of grammar Production array self.lr_goto_cache = {} # Cache of computed gotos self.lr0_cidhash = {} # Cache of closures self._add_count = 0 # Internal counter used to detect cycles # Diagonistic information filled in by the table generator self.sr_conflict = 0 self.rr_conflict = 0 self.conflicts = [] # List of conflicts self.sr_conflicts = [] self.rr_conflicts = [] # Build the tables self.grammar.build_lritems() self.grammar.compute_first() self.grammar.compute_follow() self.lr_parse_table() # Compute the LR(0) closure operation on I, where I is a set of LR(0) items. def lr0_closure(self, I): self._add_count += 1 # Add everything in I to J J = I[:] didadd = True while didadd: didadd = False for j in J: for x in j.lr_after: if getattr(x, 'lr0_added', 0) == self._add_count: continue # Add B --> .G to J J.append(x.lr_next) x.lr0_added = self._add_count didadd = True return J # Compute the LR(0) goto function goto(I,X) where I is a set # of LR(0) items and X is a grammar symbol. This function is written # in a way that guarantees uniqueness of the generated goto sets # (i.e. the same goto set will never be returned as two different Python # objects). With uniqueness, we can later do fast set comparisons using # id(obj) instead of element-wise comparison. def lr0_goto(self, I, x): # First we look for a previously cached entry g = self.lr_goto_cache.get((id(I), x)) if g: return g # Now we generate the goto set in a way that guarantees uniqueness # of the result s = self.lr_goto_cache.get(x) if not s: s = {} self.lr_goto_cache[x] = s gs = [] for p in I: n = p.lr_next if n and n.lr_before == x: s1 = s.get(id(n)) if not s1: s1 = {} s[id(n)] = s1 gs.append(n) s = s1 g = s.get('$end') if not g: if gs: g = self.lr0_closure(gs) s['$end'] = g else: s['$end'] = gs self.lr_goto_cache[(id(I), x)] = g return g # Compute the LR(0) sets of item function def lr0_items(self): C = [self.lr0_closure([self.grammar.Productions[0].lr_next])] i = 0 for I in C: self.lr0_cidhash[id(I)] = i i += 1 # Loop over the items in C and each grammar symbols i = 0 while i < len(C): I = C[i] i += 1 # Collect all of the symbols that could possibly be in the goto(I,X) sets asyms = {} for ii in I: for s in ii.usyms: asyms[s] = None for x in asyms: g = self.lr0_goto(I, x) if not g or id(g) in self.lr0_cidhash: continue self.lr0_cidhash[id(g)] = len(C) C.append(g) return C # ----------------------------------------------------------------------------- # ==== LALR(1) Parsing ==== # # LALR(1) parsing is almost exactly the same as SLR except that instead of # relying upon Follow() sets when performing reductions, a more selective # lookahead set that incorporates the state of the LR(0) machine is utilized. # Thus, we mainly just have to focus on calculating the lookahead sets. # # The method used here is due to DeRemer and Pennelo (1982). # # DeRemer, F. L., and T. J. Pennelo: "Efficient Computation of LALR(1) # Lookahead Sets", ACM Transactions on Programming Languages and Systems, # Vol. 4, No. 4, Oct. 1982, pp. 615-649 # # Further details can also be found in: # # J. Tremblay and P. Sorenson, "The Theory and Practice of Compiler Writing", # McGraw-Hill Book Company, (1985). # # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # compute_nullable_nonterminals() # # Creates a dictionary containing all of the non-terminals that might produce # an empty production. # ----------------------------------------------------------------------------- def compute_nullable_nonterminals(self): nullable = set() num_nullable = 0 while True: for p in self.grammar.Productions[1:]: if p.len == 0: nullable.add(p.name) continue for t in p.prod: if t not in nullable: break else: nullable.add(p.name) if len(nullable) == num_nullable: break num_nullable = len(nullable) return nullable # ----------------------------------------------------------------------------- # find_nonterminal_trans(C) # # Given a set of LR(0) items, this functions finds all of the non-terminal # transitions. These are transitions in which a dot appears immediately before # a non-terminal. Returns a list of tuples of the form (state,N) where state # is the state number and N is the nonterminal symbol. # # The input C is the set of LR(0) items. # ----------------------------------------------------------------------------- def find_nonterminal_transitions(self, C): trans = [] for stateno, state in enumerate(C): for p in state: if p.lr_index < p.len - 1: t = (stateno, p.prod[p.lr_index+1]) if t[1] in self.grammar.Nonterminals: if t not in trans: trans.append(t) return trans # ----------------------------------------------------------------------------- # dr_relation() # # Computes the DR(p,A) relationships for non-terminal transitions. The input # is a tuple (state,N) where state is a number and N is a nonterminal symbol. # # Returns a list of terminals. # ----------------------------------------------------------------------------- def dr_relation(self, C, trans, nullable): dr_set = {} state, N = trans terms = [] g = self.lr0_goto(C[state], N) for p in g: if p.lr_index < p.len - 1: a = p.prod[p.lr_index+1] if a in self.grammar.Terminals: if a not in terms: terms.append(a) # This extra bit is to handle the start state if state == 0 and N == self.grammar.Productions[0].prod[0]: terms.append('$end') return terms # ----------------------------------------------------------------------------- # reads_relation() # # Computes the READS() relation (p,A) READS (t,C). # ----------------------------------------------------------------------------- def reads_relation(self, C, trans, empty): # Look for empty transitions rel = [] state, N = trans g = self.lr0_goto(C[state], N) j = self.lr0_cidhash.get(id(g), -1) for p in g: if p.lr_index < p.len - 1: a = p.prod[p.lr_index + 1] if a in empty: rel.append((j, a)) return rel # ----------------------------------------------------------------------------- # compute_lookback_includes() # # Determines the lookback and includes relations # # LOOKBACK: # # This relation is determined by running the LR(0) state machine forward. # For example, starting with a production "N : . A B C", we run it forward # to obtain "N : A B C ." We then build a relationship between this final # state and the starting state. These relationships are stored in a dictionary # lookdict. # # INCLUDES: # # Computes the INCLUDE() relation (p,A) INCLUDES (p',B). # # This relation is used to determine non-terminal transitions that occur # inside of other non-terminal transition states. (p,A) INCLUDES (p', B) # if the following holds: # # B -> LAT, where T -> epsilon and p' -L-> p # # L is essentially a prefix (which may be empty), T is a suffix that must be # able to derive an empty string. State p' must lead to state p with the string L. # # ----------------------------------------------------------------------------- def compute_lookback_includes(self, C, trans, nullable): lookdict = {} # Dictionary of lookback relations includedict = {} # Dictionary of include relations # Make a dictionary of non-terminal transitions dtrans = {} for t in trans: dtrans[t] = 1 # Loop over all transitions and compute lookbacks and includes for state, N in trans: lookb = [] includes = [] for p in C[state]: if p.name != N: continue # Okay, we have a name match. We now follow the production all the way # through the state machine until we get the . on the right hand side lr_index = p.lr_index j = state while lr_index < p.len - 1: lr_index = lr_index + 1 t = p.prod[lr_index] # Check to see if this symbol and state are a non-terminal transition if (j, t) in dtrans: # Yes. Okay, there is some chance that this is an includes relation # the only way to know for certain is whether the rest of the # production derives empty li = lr_index + 1 while li < p.len: if p.prod[li] in self.grammar.Terminals: break # No forget it if p.prod[li] not in nullable: break li = li + 1 else: # Appears to be a relation between (j,t) and (state,N) includes.append((j, t)) g = self.lr0_goto(C[j], t) # Go to next set j = self.lr0_cidhash.get(id(g), -1) # Go to next state # When we get here, j is the final state, now we have to locate the production for r in C[j]: if r.name != p.name: continue if r.len != p.len: continue i = 0 # This look is comparing a production ". A B C" with "A B C ." while i < r.lr_index: if r.prod[i] != p.prod[i+1]: break i = i + 1 else: lookb.append((j, r)) for i in includes: if i not in includedict: includedict[i] = [] includedict[i].append((state, N)) lookdict[(state, N)] = lookb return lookdict, includedict # ----------------------------------------------------------------------------- # compute_read_sets() # # Given a set of LR(0) items, this function computes the read sets. # # Inputs: C = Set of LR(0) items # ntrans = Set of nonterminal transitions # nullable = Set of empty transitions # # Returns a set containing the read sets # ----------------------------------------------------------------------------- def compute_read_sets(self, C, ntrans, nullable): FP = lambda x: self.dr_relation(C, x, nullable) R = lambda x: self.reads_relation(C, x, nullable) F = digraph(ntrans, R, FP) return F # ----------------------------------------------------------------------------- # compute_follow_sets() # # Given a set of LR(0) items, a set of non-terminal transitions, a readset, # and an include set, this function computes the follow sets # # Follow(p,A) = Read(p,A) U U {Follow(p',B) | (p,A) INCLUDES (p',B)} # # Inputs: # ntrans = Set of nonterminal transitions # readsets = Readset (previously computed) # inclsets = Include sets (previously computed) # # Returns a set containing the follow sets # ----------------------------------------------------------------------------- def compute_follow_sets(self, ntrans, readsets, inclsets): FP = lambda x: readsets[x] R = lambda x: inclsets.get(x, []) F = digraph(ntrans, R, FP) return F # ----------------------------------------------------------------------------- # add_lookaheads() # # Attaches the lookahead symbols to grammar rules. # # Inputs: lookbacks - Set of lookback relations # followset - Computed follow set # # This function directly attaches the lookaheads to productions contained # in the lookbacks set # ----------------------------------------------------------------------------- def add_lookaheads(self, lookbacks, followset): for trans, lb in lookbacks.items(): # Loop over productions in lookback for state, p in lb: if state not in p.lookaheads: p.lookaheads[state] = [] f = followset.get(trans, []) for a in f: if a not in p.lookaheads[state]: p.lookaheads[state].append(a) # ----------------------------------------------------------------------------- # add_lalr_lookaheads() # # This function does all of the work of adding lookahead information for use # with LALR parsing # ----------------------------------------------------------------------------- def add_lalr_lookaheads(self, C): # Determine all of the nullable nonterminals nullable = self.compute_nullable_nonterminals() # Find all non-terminal transitions trans = self.find_nonterminal_transitions(C) # Compute read sets readsets = self.compute_read_sets(C, trans, nullable) # Compute lookback/includes relations lookd, included = self.compute_lookback_includes(C, trans, nullable) # Compute LALR FOLLOW sets followsets = self.compute_follow_sets(trans, readsets, included) # Add all of the lookaheads self.add_lookaheads(lookd, followsets) # ----------------------------------------------------------------------------- # lr_parse_table() # # This function constructs the parse tables for SLR or LALR # ----------------------------------------------------------------------------- def lr_parse_table(self): Productions = self.grammar.Productions Precedence = self.grammar.Precedence goto = self.lr_goto # Goto array action = self.lr_action # Action array log = self.log # Logger for output actionp = {} # Action production array (temporary) log.info('Parsing method: %s', self.lr_method) # Step 1: Construct C = { I0, I1, ... IN}, collection of LR(0) items # This determines the number of states C = self.lr0_items() if self.lr_method == 'LALR': self.add_lalr_lookaheads(C) # Build the parser table, state by state st = 0 for I in C: # Loop over each production in I actlist = [] # List of actions st_action = {} st_actionp = {} st_goto = {} log.info('') log.info('state %d', st) log.info('') for p in I: log.info(' (%d) %s', p.number, p) log.info('') for p in I: if p.len == p.lr_index + 1: if p.name == "S'": # Start symbol. Accept! st_action['$end'] = 0 st_actionp['$end'] = p else: # We are at the end of a production. Reduce! if self.lr_method == 'LALR': laheads = p.lookaheads[st] else: laheads = self.grammar.Follow[p.name] for a in laheads: actlist.append((a, p, 'reduce using rule %d (%s)' % (p.number, p))) r = st_action.get(a) if r is not None: # Whoa. Have a shift/reduce or reduce/reduce conflict if r > 0: # Need to decide on shift or reduce here # By default we favor shifting. Need to add # some precedence rules here. # Shift precedence comes from the token sprec, slevel = Precedence.get(a, ('right', 0)) # Reduce precedence comes from rule being reduced (p) rprec, rlevel = Productions[p.number].prec if (slevel < rlevel) or ((slevel == rlevel) and (rprec == 'left')): # We really need to reduce here. st_action[a] = -p.number st_actionp[a] = p if not slevel and not rlevel: log.info(' ! shift/reduce conflict for %s resolved as reduce', a) self.sr_conflicts.append((st, a, 'reduce')) Productions[p.number].reduced += 1 elif (slevel == rlevel) and (rprec == 'nonassoc'): st_action[a] = None else: # Hmmm. Guess we'll keep the shift if not rlevel: log.info(' ! shift/reduce conflict for %s resolved as shift', a) self.sr_conflicts.append((st, a, 'shift')) elif r < 0: # Reduce/reduce conflict. In this case, we favor the rule # that was defined first in the grammar file oldp = Productions[-r] pp = Productions[p.number] if oldp.line > pp.line: st_action[a] = -p.number st_actionp[a] = p chosenp, rejectp = pp, oldp Productions[p.number].reduced += 1 Productions[oldp.number].reduced -= 1 else: chosenp, rejectp = oldp, pp self.rr_conflicts.append((st, chosenp, rejectp)) log.info(' ! reduce/reduce conflict for %s resolved using rule %d (%s)', a, st_actionp[a].number, st_actionp[a]) else: raise LALRError('Unknown conflict in state %d' % st) else: st_action[a] = -p.number st_actionp[a] = p Productions[p.number].reduced += 1 else: i = p.lr_index a = p.prod[i+1] # Get symbol right after the "." if a in self.grammar.Terminals: g = self.lr0_goto(I, a) j = self.lr0_cidhash.get(id(g), -1) if j >= 0: # We are in a shift state actlist.append((a, p, 'shift and go to state %d' % j)) r = st_action.get(a) if r is not None: # Whoa have a shift/reduce or shift/shift conflict if r > 0: if r != j: raise LALRError('Shift/shift conflict in state %d' % st) elif r < 0: # Do a precedence check. # - if precedence of reduce rule is higher, we reduce. # - if precedence of reduce is same and left assoc, we reduce. # - otherwise we shift # Shift precedence comes from the token sprec, slevel = Precedence.get(a, ('right', 0)) # Reduce precedence comes from the rule that could have been reduced rprec, rlevel = Productions[st_actionp[a].number].prec if (slevel > rlevel) or ((slevel == rlevel) and (rprec == 'right')): # We decide to shift here... highest precedence to shift Productions[st_actionp[a].number].reduced -= 1 st_action[a] = j st_actionp[a] = p if not rlevel: log.info(' ! shift/reduce conflict for %s resolved as shift', a) self.sr_conflicts.append((st, a, 'shift')) elif (slevel == rlevel) and (rprec == 'nonassoc'): st_action[a] = None else: # Hmmm. Guess we'll keep the reduce if not slevel and not rlevel: log.info(' ! shift/reduce conflict for %s resolved as reduce', a) self.sr_conflicts.append((st, a, 'reduce')) else: raise LALRError('Unknown conflict in state %d' % st) else: st_action[a] = j st_actionp[a] = p # Print the actions associated with each terminal _actprint = {} for a, p, m in actlist: if a in st_action: if p is st_actionp[a]: log.info(' %-15s %s', a, m) _actprint[(a, m)] = 1 log.info('') # Print the actions that were not used. (debugging) not_used = 0 for a, p, m in actlist: if a in st_action: if p is not st_actionp[a]: if not (a, m) in _actprint: log.debug(' ! %-15s [ %s ]', a, m) not_used = 1 _actprint[(a, m)] = 1 if not_used: log.debug('') # Construct the goto table for this state nkeys = {} for ii in I: for s in ii.usyms: if s in self.grammar.Nonterminals: nkeys[s] = None for n in nkeys: g = self.lr0_goto(I, n) j = self.lr0_cidhash.get(id(g), -1) if j >= 0: st_goto[n] = j log.info(' %-30s shift and go to state %d', n, j) action[st] = st_action actionp[st] = st_actionp goto[st] = st_goto st += 1 # ----------------------------------------------------------------------------- # write() # # This function writes the LR parsing tables to a file # ----------------------------------------------------------------------------- def write_table(self, tabmodule, outputdir='', signature=''): if isinstance(tabmodule, types.ModuleType): raise IOError("Won't overwrite existing tabmodule") basemodulename = tabmodule.split('.')[-1] filename = os.path.join(outputdir, basemodulename) + '.py' try: f = open(filename, 'w') f.write(''' # %s # This file is automatically generated. Do not edit. _tabversion = %r _lr_method = %r _lr_signature = %r ''' % (os.path.basename(filename), __tabversion__, self.lr_method, signature)) # Change smaller to 0 to go back to original tables smaller = 1 # Factor out names to try and make smaller if smaller: items = {} for s, nd in self.lr_action.items(): for name, v in nd.items(): i = items.get(name) if not i: i = ([], []) items[name] = i i[0].append(s) i[1].append(v) f.write('\n_lr_action_items = {') for k, v in items.items(): f.write('%r:([' % k) for i in v[0]: f.write('%r,' % i) f.write('],[') for i in v[1]: f.write('%r,' % i) f.write(']),') f.write('}\n') f.write(''' _lr_action = {} for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items ''') else: f.write('\n_lr_action = { ') for k, v in self.lr_action.items(): f.write('(%r,%r):%r,' % (k[0], k[1], v)) f.write('}\n') if smaller: # Factor out names to try and make smaller items = {} for s, nd in self.lr_goto.items(): for name, v in nd.items(): i = items.get(name) if not i: i = ([], []) items[name] = i i[0].append(s) i[1].append(v) f.write('\n_lr_goto_items = {') for k, v in items.items(): f.write('%r:([' % k) for i in v[0]: f.write('%r,' % i) f.write('],[') for i in v[1]: f.write('%r,' % i) f.write(']),') f.write('}\n') f.write(''' _lr_goto = {} for _k, _v in _lr_goto_items.items(): for _x, _y in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items ''') else: f.write('\n_lr_goto = { ') for k, v in self.lr_goto.items(): f.write('(%r,%r):%r,' % (k[0], k[1], v)) f.write('}\n') # Write production table f.write('_lr_productions = [\n') for p in self.lr_productions: if p.func: f.write(' (%r,%r,%d,%r,%r,%d),\n' % (p.str, p.name, p.len, p.func, os.path.basename(p.file), p.line)) else: f.write(' (%r,%r,%d,None,None,None),\n' % (str(p), p.name, p.len)) f.write(']\n') f.close() except IOError as e: raise # ----------------------------------------------------------------------------- # pickle_table() # # This function pickles the LR parsing tables to a supplied file object # ----------------------------------------------------------------------------- def pickle_table(self, filename, signature=''): try: import cPickle as pickle except ImportError: import pickle with open(filename, 'wb') as outf: pickle.dump(__tabversion__, outf, pickle_protocol) pickle.dump(self.lr_method, outf, pickle_protocol) pickle.dump(signature, outf, pickle_protocol) pickle.dump(self.lr_action, outf, pickle_protocol) pickle.dump(self.lr_goto, outf, pickle_protocol) outp = [] for p in self.lr_productions: if p.func: outp.append((p.str, p.name, p.len, p.func, os.path.basename(p.file), p.line)) else: outp.append((str(p), p.name, p.len, None, None, None)) pickle.dump(outp, outf, pickle_protocol) # ----------------------------------------------------------------------------- # === INTROSPECTION === # # The following functions and classes are used to implement the PLY # introspection features followed by the yacc() function itself. # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # get_caller_module_dict() # # This function returns a dictionary containing all of the symbols defined within # a caller further down the call stack. This is used to get the environment # associated with the yacc() call if none was provided. # ----------------------------------------------------------------------------- def get_caller_module_dict(levels): f = sys._getframe(levels) ldict = f.f_globals.copy() if f.f_globals != f.f_locals: ldict.update(f.f_locals) return ldict # ----------------------------------------------------------------------------- # parse_grammar() # # This takes a raw grammar rule string and parses it into production data # ----------------------------------------------------------------------------- def parse_grammar(doc, file, line): grammar = [] # Split the doc string into lines pstrings = doc.splitlines() lastp = None dline = line for ps in pstrings: dline += 1 p = ps.split() if not p: continue try: if p[0] == '|': # This is a continuation of a previous rule if not lastp: raise SyntaxError("%s:%d: Misplaced '|'" % (file, dline)) prodname = lastp syms = p[1:] else: prodname = p[0] lastp = prodname syms = p[2:] assign = p[1] if assign != ':' and assign != '::=': raise SyntaxError("%s:%d: Syntax error. Expected ':'" % (file, dline)) grammar.append((file, dline, prodname, syms)) except SyntaxError: raise except Exception: raise SyntaxError('%s:%d: Syntax error in rule %r' % (file, dline, ps.strip())) return grammar # ----------------------------------------------------------------------------- # ParserReflect() # # This class represents information extracted for building a parser including # start symbol, error function, tokens, precedence list, action functions, # etc. # ----------------------------------------------------------------------------- class ParserReflect(object): def __init__(self, pdict, log=None): self.pdict = pdict self.start = None self.error_func = None self.tokens = None self.modules = set() self.grammar = [] self.error = False if log is None: self.log = PlyLogger(sys.stderr) else: self.log = log # Get all of the basic information def get_all(self): self.get_start() self.get_error_func() self.get_tokens() self.get_precedence() self.get_pfunctions() # Validate all of the information def validate_all(self): self.validate_start() self.validate_error_func() self.validate_tokens() self.validate_precedence() self.validate_pfunctions() self.validate_modules() return self.error # Compute a signature over the grammar def signature(self): parts = [] try: if self.start: parts.append(self.start) if self.prec: parts.append(''.join([''.join(p) for p in self.prec])) if self.tokens: parts.append(' '.join(self.tokens)) for f in self.pfuncs: if f[3]: parts.append(f[3]) except (TypeError, ValueError): pass return ''.join(parts) # ----------------------------------------------------------------------------- # validate_modules() # # This method checks to see if there are duplicated p_rulename() functions # in the parser module file. Without this function, it is really easy for # users to make mistakes by cutting and pasting code fragments (and it's a real # bugger to try and figure out why the resulting parser doesn't work). Therefore, # we just do a little regular expression pattern matching of def statements # to try and detect duplicates. # ----------------------------------------------------------------------------- def validate_modules(self): # Match def p_funcname( fre = re.compile(r'\s*def\s+(p_[a-zA-Z_0-9]*)\(') for module in self.modules: try: lines, linen = inspect.getsourcelines(module) except IOError: continue counthash = {} for linen, line in enumerate(lines): linen += 1 m = fre.match(line) if m: name = m.group(1) prev = counthash.get(name) if not prev: counthash[name] = linen else: filename = inspect.getsourcefile(module) self.log.warning('%s:%d: Function %s redefined. Previously defined on line %d', filename, linen, name, prev) # Get the start symbol def get_start(self): self.start = self.pdict.get('start') # Validate the start symbol def validate_start(self): if self.start is not None: if not isinstance(self.start, string_types): self.log.error("'start' must be a string") # Look for error handler def get_error_func(self): self.error_func = self.pdict.get('p_error') # Validate the error function def validate_error_func(self): if self.error_func: if isinstance(self.error_func, types.FunctionType): ismethod = 0 elif isinstance(self.error_func, types.MethodType): ismethod = 1 else: self.log.error("'p_error' defined, but is not a function or method") self.error = True return eline = self.error_func.__code__.co_firstlineno efile = self.error_func.__code__.co_filename module = inspect.getmodule(self.error_func) self.modules.add(module) argcount = self.error_func.__code__.co_argcount - ismethod if argcount != 1: self.log.error('%s:%d: p_error() requires 1 argument', efile, eline) self.error = True # Get the tokens map def get_tokens(self): tokens = self.pdict.get('tokens') if not tokens: self.log.error('No token list is defined') self.error = True return if not isinstance(tokens, (list, tuple)): self.log.error('tokens must be a list or tuple') self.error = True return if not tokens: self.log.error('tokens is empty') self.error = True return self.tokens = tokens # Validate the tokens def validate_tokens(self): # Validate the tokens. if 'error' in self.tokens: self.log.error("Illegal token name 'error'. Is a reserved word") self.error = True return terminals = set() for n in self.tokens: if n in terminals: self.log.warning('Token %r multiply defined', n) terminals.add(n) # Get the precedence map (if any) def get_precedence(self): self.prec = self.pdict.get('precedence') # Validate and parse the precedence map def validate_precedence(self): preclist = [] if self.prec: if not isinstance(self.prec, (list, tuple)): self.log.error('precedence must be a list or tuple') self.error = True return for level, p in enumerate(self.prec): if not isinstance(p, (list, tuple)): self.log.error('Bad precedence table') self.error = True return if len(p) < 2: self.log.error('Malformed precedence entry %s. Must be (assoc, term, ..., term)', p) self.error = True return assoc = p[0] if not isinstance(assoc, string_types): self.log.error('precedence associativity must be a string') self.error = True return for term in p[1:]: if not isinstance(term, string_types): self.log.error('precedence items must be strings') self.error = True return preclist.append((term, assoc, level+1)) self.preclist = preclist # Get all p_functions from the grammar def get_pfunctions(self): p_functions = [] for name, item in self.pdict.items(): if not name.startswith('p_') or name == 'p_error': continue if isinstance(item, (types.FunctionType, types.MethodType)): line = getattr(item, 'co_firstlineno', item.__code__.co_firstlineno) module = inspect.getmodule(item) p_functions.append((line, module, name, item.__doc__)) # Sort all of the actions by line number; make sure to stringify # modules to make them sortable, since `line` may not uniquely sort all # p functions p_functions.sort(key=lambda p_function: ( p_function[0], str(p_function[1]), p_function[2], p_function[3])) self.pfuncs = p_functions # Validate all of the p_functions def validate_pfunctions(self): grammar = [] # Check for non-empty symbols if len(self.pfuncs) == 0: self.log.error('no rules of the form p_rulename are defined') self.error = True return for line, module, name, doc in self.pfuncs: file = inspect.getsourcefile(module) func = self.pdict[name] if isinstance(func, types.MethodType): reqargs = 2 else: reqargs = 1 if func.__code__.co_argcount > reqargs: self.log.error('%s:%d: Rule %r has too many arguments', file, line, func.__name__) self.error = True elif func.__code__.co_argcount < reqargs: self.log.error('%s:%d: Rule %r requires an argument', file, line, func.__name__) self.error = True elif not func.__doc__: self.log.warning('%s:%d: No documentation string specified in function %r (ignored)', file, line, func.__name__) else: try: parsed_g = parse_grammar(doc, file, line) for g in parsed_g: grammar.append((name, g)) except SyntaxError as e: self.log.error(str(e)) self.error = True # Looks like a valid grammar rule # Mark the file in which defined. self.modules.add(module) # Secondary validation step that looks for p_ definitions that are not functions # or functions that look like they might be grammar rules. for n, v in self.pdict.items(): if n.startswith('p_') and isinstance(v, (types.FunctionType, types.MethodType)): continue if n.startswith('t_'): continue if n.startswith('p_') and n != 'p_error': self.log.warning('%r not defined as a function', n) if ((isinstance(v, types.FunctionType) and v.__code__.co_argcount == 1) or (isinstance(v, types.MethodType) and v.__func__.__code__.co_argcount == 2)): if v.__doc__: try: doc = v.__doc__.split(' ') if doc[1] == ':': self.log.warning('%s:%d: Possible grammar rule %r defined without p_ prefix', v.__code__.co_filename, v.__code__.co_firstlineno, n) except IndexError: pass self.grammar = grammar # ----------------------------------------------------------------------------- # yacc(module) # # Build a parser # ----------------------------------------------------------------------------- def yacc(method='LALR', debug=yaccdebug, module=None, tabmodule=tab_module, start=None, check_recursion=True, optimize=False, write_tables=True, debugfile=debug_file, outputdir=None, debuglog=None, errorlog=None, picklefile=None): if tabmodule is None: tabmodule = tab_module # Reference to the parsing method of the last built parser global parse # If pickling is enabled, table files are not created if picklefile: write_tables = 0 if errorlog is None: errorlog = PlyLogger(sys.stderr) # Get the module dictionary used for the parser if module: _items = [(k, getattr(module, k)) for k in dir(module)] pdict = dict(_items) # If no __file__ attribute is available, try to obtain it from the __module__ instead if '__file__' not in pdict: pdict['__file__'] = sys.modules[pdict['__module__']].__file__ else: pdict = get_caller_module_dict(2) if outputdir is None: # If no output directory is set, the location of the output files # is determined according to the following rules: # - If tabmodule specifies a package, files go into that package directory # - Otherwise, files go in the same directory as the specifying module if isinstance(tabmodule, types.ModuleType): srcfile = tabmodule.__file__ else: if '.' not in tabmodule: srcfile = pdict['__file__'] else: parts = tabmodule.split('.') pkgname = '.'.join(parts[:-1]) exec('import %s' % pkgname) srcfile = getattr(sys.modules[pkgname], '__file__', '') outputdir = os.path.dirname(srcfile) # Determine if the module is package of a package or not. # If so, fix the tabmodule setting so that tables load correctly pkg = pdict.get('__package__') if pkg and isinstance(tabmodule, str): if '.' not in tabmodule: tabmodule = pkg + '.' + tabmodule # Set start symbol if it's specified directly using an argument if start is not None: pdict['start'] = start # Collect parser information from the dictionary pinfo = ParserReflect(pdict, log=errorlog) pinfo.get_all() if pinfo.error: raise YaccError('Unable to build parser') # Check signature against table files (if any) signature = pinfo.signature() # Read the tables try: lr = LRTable() if picklefile: read_signature = lr.read_pickle(picklefile) else: read_signature = lr.read_table(tabmodule) if optimize or (read_signature == signature): try: lr.bind_callables(pinfo.pdict) parser = LRParser(lr, pinfo.error_func) parse = parser.parse return parser except Exception as e: errorlog.warning('There was a problem loading the table file: %r', e) except VersionError as e: errorlog.warning(str(e)) except ImportError: pass if debuglog is None: if debug: try: debuglog = PlyLogger(open(os.path.join(outputdir, debugfile), 'w')) except IOError as e: errorlog.warning("Couldn't open %r. %s" % (debugfile, e)) debuglog = NullLogger() else: debuglog = NullLogger() debuglog.info('Created by PLY version %s (http://www.dabeaz.com/ply)', __version__) errors = False # Validate the parser information if pinfo.validate_all(): raise YaccError('Unable to build parser') if not pinfo.error_func: errorlog.warning('no p_error() function is defined') # Create a grammar object grammar = Grammar(pinfo.tokens) # Set precedence level for terminals for term, assoc, level in pinfo.preclist: try: grammar.set_precedence(term, assoc, level) except GrammarError as e: errorlog.warning('%s', e) # Add productions to the grammar for funcname, gram in pinfo.grammar: file, line, prodname, syms = gram try: grammar.add_production(prodname, syms, funcname, file, line) except GrammarError as e: errorlog.error('%s', e) errors = True # Set the grammar start symbols try: if start is None: grammar.set_start(pinfo.start) else: grammar.set_start(start) except GrammarError as e: errorlog.error(str(e)) errors = True if errors: raise YaccError('Unable to build parser') # Verify the grammar structure undefined_symbols = grammar.undefined_symbols() for sym, prod in undefined_symbols: errorlog.error('%s:%d: Symbol %r used, but not defined as a token or a rule', prod.file, prod.line, sym) errors = True unused_terminals = grammar.unused_terminals() if unused_terminals: debuglog.info('') debuglog.info('Unused terminals:') debuglog.info('') for term in unused_terminals: errorlog.warning('Token %r defined, but not used', term) debuglog.info(' %s', term) # Print out all productions to the debug log if debug: debuglog.info('') debuglog.info('Grammar') debuglog.info('') for n, p in enumerate(grammar.Productions): debuglog.info('Rule %-5d %s', n, p) # Find unused non-terminals unused_rules = grammar.unused_rules() for prod in unused_rules: errorlog.warning('%s:%d: Rule %r defined, but not used', prod.file, prod.line, prod.name) if len(unused_terminals) == 1: errorlog.warning('There is 1 unused token') if len(unused_terminals) > 1: errorlog.warning('There are %d unused tokens', len(unused_terminals)) if len(unused_rules) == 1: errorlog.warning('There is 1 unused rule') if len(unused_rules) > 1: errorlog.warning('There are %d unused rules', len(unused_rules)) if debug: debuglog.info('') debuglog.info('Terminals, with rules where they appear') debuglog.info('') terms = list(grammar.Terminals) terms.sort() for term in terms: debuglog.info('%-20s : %s', term, ' '.join([str(s) for s in grammar.Terminals[term]])) debuglog.info('') debuglog.info('Nonterminals, with rules where they appear') debuglog.info('') nonterms = list(grammar.Nonterminals) nonterms.sort() for nonterm in nonterms: debuglog.info('%-20s : %s', nonterm, ' '.join([str(s) for s in grammar.Nonterminals[nonterm]])) debuglog.info('') if check_recursion: unreachable = grammar.find_unreachable() for u in unreachable: errorlog.warning('Symbol %r is unreachable', u) infinite = grammar.infinite_cycles() for inf in infinite: errorlog.error('Infinite recursion detected for symbol %r', inf) errors = True unused_prec = grammar.unused_precedence() for term, assoc in unused_prec: errorlog.error('Precedence rule %r defined for unknown symbol %r', assoc, term) errors = True if errors: raise YaccError('Unable to build parser') # Run the LRGeneratedTable on the grammar if debug: errorlog.debug('Generating %s tables', method) lr = LRGeneratedTable(grammar, method, debuglog) if debug: num_sr = len(lr.sr_conflicts) # Report shift/reduce and reduce/reduce conflicts if num_sr == 1: errorlog.warning('1 shift/reduce conflict') elif num_sr > 1: errorlog.warning('%d shift/reduce conflicts', num_sr) num_rr = len(lr.rr_conflicts) if num_rr == 1: errorlog.warning('1 reduce/reduce conflict') elif num_rr > 1: errorlog.warning('%d reduce/reduce conflicts', num_rr) # Write out conflicts to the output file if debug and (lr.sr_conflicts or lr.rr_conflicts): debuglog.warning('') debuglog.warning('Conflicts:') debuglog.warning('') for state, tok, resolution in lr.sr_conflicts: debuglog.warning('shift/reduce conflict for %s in state %d resolved as %s', tok, state, resolution) already_reported = set() for state, rule, rejected in lr.rr_conflicts: if (state, id(rule), id(rejected)) in already_reported: continue debuglog.warning('reduce/reduce conflict in state %d resolved using rule (%s)', state, rule) debuglog.warning('rejected rule (%s) in state %d', rejected, state) errorlog.warning('reduce/reduce conflict in state %d resolved using rule (%s)', state, rule) errorlog.warning('rejected rule (%s) in state %d', rejected, state) already_reported.add((state, id(rule), id(rejected))) warned_never = [] for state, rule, rejected in lr.rr_conflicts: if not rejected.reduced and (rejected not in warned_never): debuglog.warning('Rule (%s) is never reduced', rejected) errorlog.warning('Rule (%s) is never reduced', rejected) warned_never.append(rejected) # Write the table file if requested if write_tables: try: lr.write_table(tabmodule, outputdir, signature) except IOError as e: errorlog.warning("Couldn't create %r. %s" % (tabmodule, e)) # Write a pickled version of the tables if picklefile: try: lr.pickle_table(picklefile, signature) except IOError as e: errorlog.warning("Couldn't create %r. %s" % (picklefile, e)) # Build the parser lr.bind_callables(pinfo.pdict) parser = LRParser(lr, pinfo.error_func) parse = parser.parse return parser ply/ygen.py000064400000004313147205113120006661 0ustar00# ply: ygen.py # # This is a support program that auto-generates different versions of the YACC parsing # function with different features removed for the purposes of performance. # # Users should edit the method LParser.parsedebug() in yacc.py. The source code # for that method is then used to create the other methods. See the comments in # yacc.py for further details. import os.path import shutil def get_source_range(lines, tag): srclines = enumerate(lines) start_tag = '#--! %s-start' % tag end_tag = '#--! %s-end' % tag for start_index, line in srclines: if line.strip().startswith(start_tag): break for end_index, line in srclines: if line.strip().endswith(end_tag): break return (start_index + 1, end_index) def filter_section(lines, tag): filtered_lines = [] include = True tag_text = '#--! %s' % tag for line in lines: if line.strip().startswith(tag_text): include = not include elif include: filtered_lines.append(line) return filtered_lines def main(): dirname = os.path.dirname(__file__) shutil.copy2(os.path.join(dirname, 'yacc.py'), os.path.join(dirname, 'yacc.py.bak')) with open(os.path.join(dirname, 'yacc.py'), 'r') as f: lines = f.readlines() parse_start, parse_end = get_source_range(lines, 'parsedebug') parseopt_start, parseopt_end = get_source_range(lines, 'parseopt') parseopt_notrack_start, parseopt_notrack_end = get_source_range(lines, 'parseopt-notrack') # Get the original source orig_lines = lines[parse_start:parse_end] # Filter the DEBUG sections out parseopt_lines = filter_section(orig_lines, 'DEBUG') # Filter the TRACKING sections out parseopt_notrack_lines = filter_section(parseopt_lines, 'TRACKING') # Replace the parser source sections with updated versions lines[parseopt_notrack_start:parseopt_notrack_end] = parseopt_notrack_lines lines[parseopt_start:parseopt_end] = parseopt_lines lines = [line.rstrip()+'\n' for line in lines] with open(os.path.join(dirname, 'yacc.py'), 'w') as f: f.writelines(lines) print('Updated yacc.py') if __name__ == '__main__': main() ply/__pycache__/__init__.cpython-38.pyc000064400000000323147205113120013741 0ustar00U aff@sdZddgZdS)z3.9lexZyaccN) __version____all__rrG/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/ply/__init__.pysply/__pycache__/cpp.cpython-38.pyc000064400000037346147205113120013003 0ustar00U af @s`ddlZejjdkreefZneZeZdZdZ ddZ dZ dZ d Z d d ZeZd Zd dZddZddZddZddZddlZddlZddlZddlZedZddddddddd d! Zd"d#ZGd$d%d%eZ Gd&d'd'eZ!e"d(kr\ddl#m$Z$e$$Z%ddlZe&ej'd)Z(e()Z*e!e%Z+e+,e*ej'd)e+-Z.e.sLq\e/e+j0e.q:dS)*N) ZCPP_ID CPP_INTEGERZ CPP_FLOATZ CPP_STRINGZCPP_CHARCPP_WSZ CPP_COMMENT1Z CPP_COMMENT2Z CPP_POUNDZ CPP_DPOUNDz+-*/%|&~^<>=!?()[]{}.,;:\'"cCs|jj|jd7_|S)z\s+ lexerlinenovaluecounttr B/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/ply/cpp.pyt_CPP_WSsrz\#z\#\#z[A-Za-z_][\w_]*cCs|S)zA(((((0x)|(0X))[0-9a-fA-F]+)|(\d+))([uU][lL]|[lL][uU]|[uU]|[lL])?)r r r r rr+srz?((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?cCs|jj|jd7_|S)z\"([^\\\n]|(\\(.|\n)))*?\"rrr r r r t_CPP_STRING5srcCs|jj|jd7_|S)z(L)?\'([^\\\n]|(\\(.|\n)))*?\'rrr r r r t_CPP_CHAR;srcCs8|jd}|jj|7_d|_|r.d|nd|_|S)z(/\*(.|\n)*?\*/)rr )r r rrtype)r Zncrr r rt_CPP_COMMENT1As  rcCsd|_d|_|S)z (//.*?(\n|$))rr)rr r r r rt_CPP_COMMENT2JsrcCs(|jd|_|jd|_|jd|SNr)r rrskipr r r rt_errorPs   rz\?\?[=/\'\(\)\!<>\-]#\^[]|{}~) =/'()!<>-cCstdd|S)NcSst|dSN) _trigraph_repgroup)gr r rzztrigraph..) _trigraph_patsub)inputr r rtrigraphysr6c@seZdZdddZdS)MacroNFcCs0||_||_||_||_|r&|d|_d|_dSr,)namer arglistvariadicvarargsource)selfr8r r9r:r r r__init__s zMacro.__init__)NF)__name__ __module__ __qualname__r>r r r rr7sr7c@seZdZd&ddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ d'ddZ ddZd(ddZddZddZd d!Zdifd"d#Zd$d%ZdS)) PreprocessorNcCsl|dkrtj}||_i|_g|_g|_|t}|dt d||dt d|d|_ dS)Nz __DATE__ "%s"z%b %d %Yz __TIME__ "%s"z%H:%M:%S) lexrmacrospath temp_pathlexprobetime localtimedefinestrftimeparser)r=rtmr r rr>szPreprocessor.__init__cCs0g}|j||j}|s q,||q|SN)rr5tokenappend)r=texttokenstokr r rtokenizes   zPreprocessor.tokenizecCstd|||fdS)Nz%s:%d %s)print)r=filelinemsgr r rerrorszPreprocessor.errorc Cs|jd|j}|r$|jdkr.tdn|j|_|jd|j}|r^t|jdkrhtdn|j|_t|j|_ |jd|j}|r|jdkrtdn|j|_ |jd|j}|r|jdkrd|_ n|j|_ |jd |j}|r|jd krd|_ td n|j|_ |j |j f|_ d d d ddddddg }|D]:}|j||j}|rz|j|krNtd|qNdS)N identifierz"Couldn't determine identifier typeZ12345i90zCouldn't determine integer typez "filename"zCouldn't determine string typez rz%Couldn't determine token for newlinesr)r*r##rr&r',.z,Unable to lex '%s' required for preprocessor)rr5rOr rUrt_IDint t_INTEGERt_INTEGER_TYPEt_STRINGZt_SPACEZ t_NEWLINEt_WS)r=rScharscr r rrGsD                 zPreprocessor.lexprobecCs|j|dSrN)rErP)r=rEr r radd_path szPreprocessor.add_pathccs|j}dd|D}tt|D]T}|d}||dr(|t|kr(||dd||||<d||<|d7}q4q(d|}||d|_g}| }|sq| ||j |j krd|j kr|Vg}q|r|VdS)NcSsg|] }|qSr )rstrip.0xr r r sz,Preprocessor.group_lines..rrr-r)rclone splitlinesxrangelenendswithjoinr5rrOrPrrcr )r=r5rClinesij current_linerSr r r group_liness*     zPreprocessor.group_linescCstd}|t|kr*||j|jkr*|d7}q|d|=t|d}|dkrb||j|jkrb|d8}q@||dd=|Sr)rprrc)r=rRrtr r r tokenstrip8s    zPreprocessor.tokenstripc Csg}g}g}d}t|}d}||kr>||j|jkr>|d7}q||krd||jdkrd||dn ||j|djddggfS|d7}||kr`||}|jdkr|||d7}n|jdkr|d8}|dkr|r||||||d||fS||nD|jdkrL|dkrL|||||dg}n |||d7}q||j|djddggfS) Nrrr&zMissing '(' in macro argumentsr'r\r-zMissing ')' in macro arguments) rprrcr rPrYr<rrx) r= tokenlistargs positionsZ current_argZnestingZtokenlenrtr r r r collect_argsTsD            zPreprocessor.collect_argscCsg|_g|_g|_d}|t|jkr|j|j|jkrh|j|j|jkrh|j|j|j}|dkr|j|djdkrt |j||j|<|j |j|_|j|d=|j ||dfqn|dkr |j|djdkr |j d||df|j|d=qnZ|dt|jkrT|j|djdkrT|j d||f|d7}qn|j d||fn|j|jdkr|j r|dkr|j|djdkr|dt|jkr|j|dj|jkr|j|dj|j kr|j |d|d7}q|jjdd d d dS) Nrrrr[reer\cSs|dS)Nr )rjr r rr1r2z,Preprocessor.macro_prescan..T)keyreverse)patch str_patchvar_comma_patchrpr rr^r9indexcopyrbrPr:r;sort)r=macrortargnumr r r macro_prescansB(   *( zPreprocessor.macro_prescanc Cs dd|jD}i}|jD]X\}}||krRdddd||Ddd||<t||||<||||_qd}|jr|d s|jD]}d||<d }qi}|jD]^\} }}| d kr|||||d <q| d kr||kr|||||<|||||d <q|rdd|D}|S)NcSsg|]}t|qSr rri_xr r rrksz2Preprocessor.macro_expand_args..z"%s"rlcSsg|] }|jqSr r rhr r rrksrz\\Fr-Trerr}cSsg|] }|r|qSr r riZ_ir r rrks) r rrrreplacerr:rr expand_macros) r=rrzrepZ str_expansionrrtZ comma_patchexpandedptyper r rmacro_expand_argss.( zPreprocessor.macro_expand_argscCs|dkr i}d}|t|kr||}|j|jkr|j|jkr|j|krd||j<|j|j}|js|dd|jD|}|D] }|j|_q||||d<|t|7}n|d}|t|kr||j|jkr|d7}q||jdkr| ||d\} } } |j sTt| t|jkrT| |j |jd|jt|jf|| }n@|j rt| t|jdkrt|jdkr| |j |jd |jt|jdfn&| |j |jd |jt|jdf|| }n|j rLt| t|jdkr| gnD||| t|jd|| d| t|jd<| t|jd=||| } || |} | D]} |j| _qh| |||| <|t| 7}||j=qn"|jd kr|j|_||j|_|d7}q|S) NrTcSsg|]}t|qSr rrr r rrksz.Preprocessor.expand_macros..rr&zMacro %s requires %d argumentsr~z(Macro %s must have at least %d argumentsz'Macro %s must have at least %d argumentZ__LINE__)rprr^r rDr9rrrcr|r:rYr<rPrr`ra)r=rRrrtr mexr}rutokcountrzr{rrr r rrs\    "  (&  4      zPreprocessor.expand_macroscCsNd}|t|kr||j|jkr||jdkr|d}d}d}|t|kr||j|jkrl|d7}qDnn||j|jkr||j|jkrd}nd}|sqn<||jdkrd}n(||jd krqn||j||jd |d7}qD|j ||_| |||_||d|d=|d7}q| |}t |D]\}}|j|jkrpt |||<|j ||_| d||_n`|j|j kr.t |||<t||j||_||jd d kr.||jdd ||_qq.d dd|D}|dd}|dd}|dd}z t|}Wn0tk rH||j|djdd}YnX|S)NrdefinedrFZ0LZ1Lr&Tr'zMalformed defined()r-Z0123456789abcdefABCDEFrlcSsg|]}t|jqSr strr rhr r rrkSsz)Preprocessor.evalexpr..z&&z and z||z or r(z not zCouldn't evaluate expression)rprr^r rcrDrYr<rr`rar enumeraterrrrreval Exception)r=rRrtruZ needparenresultr exprr r revalexpr(s^"            zPreprocessor.evalexprccst|}||}|sd}|d|||_g}d}d}g}|D],} t| D]\} } | j|jkrPqjqP| jdkrb| D]$} | j|jkrzd| jkrz|| qz| | | dd} | r| dj} | | dd}nd} g}| d kr|r`| |D] } | Vqg}||qp| d krz|r`| |D] } | Vq2g}|j d }| |D] } | VqX||j d <||_qp| d kr|r`| |D] } | Vqg}| |qp| d kr|||f|r`|dj|j krd}d}nd}qp| dkr8|||f|r`|dj|j kr0d}d}nd}qp| dkrv|||f|r`||}|spd}d}nd}n| dkr|r|ddr|rd}n|s||}|rd}d}n||j| djdn| dkr*|r|ddr(|rd}n|s(d}d}n||j| djdn6| dkrp|rH|\}}n||j| djdnqB|rB|| qB| |D] } | Vq|g}dS)Nrlz __FILE__ "%s"TFrrrrrJincludeZ__FILE__undefZifdefZifndefifelifr-zMisplaced #elifelsezMisplaced #elseendifzMisplaced #endif)r6rwrJr<rrrcr rPrxrrDrrrrYrpopextend)r=r5r<r rschunkenableZ iftriggerZifstackrjrtrSZ dirtokensr8rzZoldfilerr r rparsegencs                         zPreprocessor.parsegenc cs|sdS|r|djdkr4|dj|jkr4||}|djdkrd}|t|krl||jdkrbqx|d7}qFtddSddd|d|D}|jdg|j}nB|dj|jkr|djdd }|jdg|j}n td dS|D]}t j||}zbt |d  }t j |}|r0|j d||||D] } | Vq<|rX|jd=WqWqtk rxYqXqtd |dS) Nrr)rr*zMalformed #include <...>rlcSsg|] }|jqSr rrhr r rrksz(Preprocessor.include..r-zMalformed #include statementrzCouldn't find '%s')r rrbrrprUrrrErFosopenreaddirnameinsertrIOError) r=rRrtfilenamerEpZinamedataZdnamerSr r rrsF      zPreprocessor.includecCst|tr||}|}zz|d}t|dkr:|d}nd}|s^t|jg}||j|j<n4|j|jkrt|j| |dd}||j|j<n|jdkr| |dd\}}}d} |D]} | rt dqd dd | D} | d kr d } |j | d_d | d_d } | dd=qnb| d dd kr| dj|j krd } | dd=| djd dd kr| djdd | d_qt| dks| dj|j krt dqq| |d|d} d} | t| krX| dt| krL| | j|jkr| | djdkr| | =qn0| | jdkrL| | dj|jkrL| | d=| d7} qt|j| dd |D| }||||j|j<nt dWntk rt dYnXdS)Nrrr~r&Fz0No more arguments may follow a variadic argumentrlcSsg|]}t|jqSr rrr r rrk1sz'Preprocessor.define..z...TZ __VA_ARGS__zInvalid macro argumentr[cSsg|]}|djqS)rrrhr r rrkOszBad macro definition) isinstance STRING_TYPESrTrpr7r rDrrcrxr|rUrrr^r LookupError)r=rRZlinetokr8mtyperrrzr{r:aZastrZmvaluertr r rrJsl           $ &&    zPreprocessor.definecCs0|dj}z |j|=Wntk r*YnXdS)Nr)r rDr)r=rRidr r rr]s   zPreprocessor.undefcCs||_||||_dSrN)ignorerrL)r=r5r<rr r rparseiszPreprocessor.parsecCsDz"t|j}|j|jkr|WSqWntk r>d|_YdSXdSrN)nextrLrr StopIteration)r=rSr r rrOrs  zPreprocessor.token)N)N)N)r?r@rAr>rTrYrGrfrwrxr|rrrrrrrJrrrOr r r rrBs&  < !5+2 B; 1F  rB__main__r)1sys version_infomajorrunicoderrangerorRliteralsrZ t_CPP_POUNDZ t_CPP_DPOUNDZt_CPP_IDrZ t_CPP_INTEGERZ t_CPP_FLOATrrrrrrerrHos.pathrcompiler3r.r6objectr7rBr?Zply.lexrCrrargvfrr5rrrOrSrUr<r r r r sj     c  ply/__pycache__/ctokens.cpython-38.pyc000064400000004332147205113120013654 0ustar00U afi 4@sLdddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3g4Zd4Zd5Zd6Zd7Zd8Zd9Zd:Zd;ZdZ d?Z d@Z dAZdBZdCZdDZdEZdFZdGZdHZdIZdJZdKZdLZdMZdNZdOZdPZdQZdRZdSZ dTZ!dUZ"dVZ#dWZ$dXZ%dYZ&dZZ'd[Z(d\Z)d]Z*d^Z+d_Z,d`Z-daZ.dbZ/dcZ0ddZ1deZ2dfZ3dgdhZ4didjZ5dkS)lZIDZTYPEIDZINTEGERFLOATSTRINGZ CHARACTERPLUSMINUSZTIMESZDIVIDEZMODULOORANDZNOTZXORZLSHIFTZRSHIFTZLORZLANDZLNOTLTZLEGTZGEZEQZNEZEQUALSZ TIMESEQUALZDIVEQUALZMODEQUAL PLUSEQUALZ MINUSEQUALZ LSHIFTEQUALZ RSHIFTEQUALZANDEQUALZXOREQUALZOREQUALZ INCREMENTZ DECREMENTZARROWZTERNARYLPARENRPARENLBRACKETRBRACKETLBRACERBRACECOMMAZPERIODSEMICOLONELLIPSISz\+-z\*/%z\|&~z\^z<>z\|\|z&&!<>z<=z>=z==z!==z\*=z/=z%=z\+=z-=z<<=z>>=z&=z\|=z\^=z\+\+z--z->z\?z\(z\)z\[z\]z\{z\},z\.;:z\.\.\.z[A-Za-z_][A-Za-z0-9_]*z!\d+([uU]|[lL]|[uU][lL]|[lL][uU])?z?((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?z\"([^\\\n]|(\\.))*?\"z(L)?\'([^\\\n]|(\\.))*?\'cCs|jj|jd7_|S)z/\*(.|\n)*?\*/ )lexerlinenovaluecounttr'F/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/ply/ctokens.py t_COMMENTvsr)cCs|jjd7_|S)z//.*\n)r!r"r%r'r'r( t_CPPCOMMENT|sr+N)6tokensZt_PLUSZt_MINUSZt_TIMESZt_DIVIDEZt_MODULOZt_ORZt_ANDZt_NOTZt_XORZt_LSHIFTZt_RSHIFTZt_LORZt_LANDZt_LNOTZt_LTZt_GTZt_LEZt_GEZt_EQZt_NEZt_EQUALSZ t_TIMESEQUALZ t_DIVEQUALZ t_MODEQUALZ t_PLUSEQUALZ t_MINUSEQUALZ t_LSHIFTEQUALZ t_RSHIFTEQUALZ t_ANDEQUALZ t_OREQUALZ t_XOREQUALZ t_INCREMENTZ t_DECREMENTZt_ARROWZ t_TERNARYZt_LPARENZt_RPARENZ t_LBRACKETZ t_RBRACKETZt_LBRACEZt_RBRACEZt_COMMAZt_PERIODZt_SEMIZt_COLONZ t_ELLIPSISZt_IDZ t_INTEGERZt_FLOATZt_STRINGZ t_CHARACTERr)r+r'r'r'r( s"ply/__pycache__/lex.cpython-38.pyc000064400000051657147205113120013012 0ustar00U af @s<dZdZddlZddlZddlZddlZddlZddlZzejej fZ Wne k rde e fZ YnXedZGdddeZGdddeZGdd d eZGd d d eZGd d d ZddZddZddZddZddZddZGdddeZdddddeejddddf ddZ d$d d!Z!d"d#Z"e"Z#dS)%z3.10Nz^[a-zA-Z0-9_]+$c@seZdZddZdS)LexErrorcCs|f|_||_dSN)argstext)selfmessagesr B/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/ply/lex.py__init__:szLexError.__init__N)__name__ __module__ __qualname__r r r r r r9src@seZdZddZddZdS)LexTokencCsd|j|j|j|jfS)NzLexToken(%s,%r,%d,%d))typevaluelinenolexposrr r r __str__AszLexToken.__str__cCst|Sr)strrr r r __repr__DszLexToken.__repr__N)r r rrrr r r r r@src@s4eZdZddZddZddZddZeZeZd S) PlyLoggercCs ||_dSrf)rrr r r r LszPlyLogger.__init__cOs|j||ddS)N rwritermsgrkwargsr r r criticalOszPlyLogger.criticalcOs|jd||ddS)Nz WARNING: rrrr r r warningRszPlyLogger.warningcOs|jd||ddS)NzERROR: rrrr r r errorUszPlyLogger.errorN) r r rr r!r"r#infodebugr r r r rKs rc@seZdZddZddZdS) NullLoggercCs|Srr )rnamer r r __getattribute__^szNullLogger.__getattribute__cOs|Srr )rrr r r r __call__aszNullLogger.__call__N)r r rr(r)r r r r r&]sr&c@s|eZdZddZdddZdddZd d Zd d Zd dZddZ ddZ ddZ ddZ ddZ ddZddZeZdS)LexercCsd|_d|_i|_i|_i|_d|_g|_d|_i|_i|_ i|_ d|_ d|_ d|_ d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)NINITIALrF)lexre lexretext lexstaterelexstateretextlexstaterenameslexstate lexstatestack lexstateinfolexstateignorelexstateerrorf lexstateeoff lexreflagslexdatarlexlen lexerrorflexeoff lextokens lexignore lexliterals lexmoduler lexoptimizerr r r r ts.zLexer.__init__Nc Cst|}|ri}|jD]t\}}g}|D]L\}}g} |D]:} | rL| dsX| | q<| t|| dj| dfqr9r@r5r0rEzipr1r2rF_funcs_to_namesr6r7r r8)rlextab outputdirZ basetabmodulefilenametfZtabre statenamelretitempatfuncZretextrenamesZtaberrrKZtabeofr r r writetabs6 & zLexer.writetabc CsBt|tjr|}ntd|tj|}t|ddtkr@td|j |_ |j |_ |j |_|j t|jB|_|j|_|j|_i|_i|_|jD]P\}}g}g}|D]&\}} |t||j t| |fq||j|<||j|<qi|_|jD]\}} || |j|<qi|_|j D]\}} || |j|<q|!ddS)N import %sZ _tabversionz0.0zInconsistent PLY versionr+)"rPrQrRexecsysmodulesrGr[ ImportErrorZ _lextokensr>Z _lexreflagsr9Z _lexliteralsr@set lextokens_allZ _lexstateinfor5Z_lexstateignorer6r0r1Z _lexstatererErFrecompile_names_to_funcsr7Z_lexstateerrorfr8Z _lexstateeoffbegin) rZtabfilefdictr`rdrerfZtxtitemrg func_namerKr r r readtabs8       z Lexer.readtabcCs8|dd}t|tstd||_d|_t||_dS)Nr-zExpected a stringr)rP StringTypes ValueErrorr:rlenr;)rrrIr r r inputs   z Lexer.inputcCsd||jkrtd|j||_|j||_|j|d|_|j|d|_ |j |d|_ ||_ dS)NzUndefined stater,) r0rzr.r1r/r6getr?r7r<r8r=r3rstater r r rus   z Lexer.begincCs|j|j||dSr)r4rFr3rur~r r r push_stateszLexer.push_statecCs||jdSr)rur4poprr r r pop_stateszLexer.pop_statecCs|jSr)r3rr r r current_state!szLexer.current_statecCs|j|7_dSr)r)rnr r r skip'sz Lexer.skipc Cs~|j}|j}|j}|j}||kr|||kr8|d7}q|jD]\}}|||}|sXq>t}||_|j |_ ||_|j } || \} |_ | s|j r| |_|S| }q| }||_ ||_||_| |} | s|j}|j}q|js(| j |jkr(td| jj| jj| j| j f||d| S|||jkrtt}|||_|j |_ |j|_ ||_|d|_|S|jrt}|j|d|_|j |_ d|_ ||_ ||_||_||} ||jkrtd||||d|j}| sq| S||_td|||f||dq|jr\t}d|_ d|_|j |_ ||_||_ ||_||} | S|d|_|jdkrztddS) Nr-z4%s:%d: Rule '%s' returned an unknown token type '%s'r#z&Scanning error. Illegal character '%s'z"Illegal character '%s' at index %deofr,z"No input string given with input())rr;r?r:r.matchrgrouprr lastindexrendlexerZlexmatchrBrqr__code__ co_filenameco_firstlinenor r@r<r= RuntimeError) rrr;r?r:r. lexindexfuncmtokirhZnewtokr r r token1s              z Lexer.tokencCs|Srr rr r r __iter__szLexer.__iter__cCs|}|dkrt|Sr)r StopIteration)rtr r r nextsz Lexer.next)N)r,)r r rr rLrjrxr|rurrrrrrr__next__r r r r r*ss  %(   nr*cCst|d|jS)Nregex)rG__doc__)rhr r r _get_regexsrcCs0t|}|j}|j|jkr,||j|Sr)rm _getframe f_globalsrDf_localsupdate)levelsrldictr r r get_caller_module_dicts     rcCsFg}t||D]2\}}|r6|dr6|||dfq||q|SrC)r^rF)Zfunclistnamelistresultrr'r r r r_s   r_cCsDg}|D]6}|r4|dr4|||d|dfq||q|SrC)rF)rrvrrr r r rts   rtcCsf|sgSd|}zt||}dgt|jd}|dd}|jD]z\}} ||d} t| t j t j fkr| ||f|| <||| <qN| dk rN||| <| ddkrd|| <qNd||f|| <qN||fg|g|gfWSt k r`tt|d} | dkrd} t|d| |||\} } }t|| d|||\}}}| || |||fYSXdS)N|r-ignore_r)NN)rWrrrsmax groupindexvaluesrEr}rrQ FunctionType MethodTypefind Exceptionintr{_form_master_re)Zrelistreflagsrtoknamesrr.rZ lexindexnamesrrhandlerllistreZlnamesZrlistZrreZrnamesr r r rs2       rcCsd}|d}t|dddD]\}}||kr |dkr q>q |dkrXt|d|}nd}d|krlt|}d||d}||fS)Nr-_ANY)r+)rT enumerater\rW)rnamesZnonstatepartsrpartstatesZ tokennamer r r _statetokens rc@sfeZdZdddZddZddZd d Zd d Zd dZddZ ddZ ddZ ddZ ddZ dS) LexerReflectNrcCsL||_d|_g|_||_ddi|_t|_d|_|dkrBtt j n||_ dS)Nr+ inclusiveF) rZ error_functokensr stateinforprnr#rrmstderrlog)rrrrr r r r /s zLexerReflect.__init__cCs$||||dSr) get_tokens get_literals get_states get_rulesrr r r get_all:szLexerReflect.get_allcCs||||jSr)validate_tokensvalidate_literalsvalidate_rulesr#rr r r validate_allAszLexerReflect.validate_allcCsp|jdd}|s(|jdd|_dSt|ttfsL|jdd|_dS|sf|jdd|_dS||_dS)NrzNo token list is definedTztokens must be a list or tupleztokens is empty)rr}rr#rPlistr\r)rrr r r rHs   zLexerReflect.get_tokenscCsPi}|jD]@}t|s,|jd|d|_||krB|jd|d||<q dS)NzBad token name '%s'TzToken '%s' multiply definedr-)r_is_identifierrrr#r")rZ terminalsrr r r r\s  zLexerReflect.validate_tokenscCs |jdd|_|jsd|_dS)Nliteralsr,)rr}rrr r r rgszLexerReflect.get_literalscCsjz>|jD]2}t|tr"t|dkr|jdt|d|_qWn&tk rd|jdd|_YnXdS)Nr-z.Invalid literal %s. Must be a single characterTzIInvalid literals specification. literals must be a sequence of characters)rrPryr{rr#rZ TypeError)rrIr r r rms   zLexerReflect.validate_literalscCs|jdd|_|jrt|jttfs:|jdd|_n|jD]}t|trZt|dkrt|jdt |d|_q@|\}}t|t s|jdt |d|_q@|dks|dks|jd |d|_q@||j kr|jd |d|_q@||j |<q@dS) Nrz)states must be defined as a tuple or listTrzMInvalid state specifier %s. Must be a tuple (statename,'exclusive|inclusive')zState name %s must be a stringr exclusivez:State type for state %s must be 'inclusive' or 'exclusive'zState '%s' already defined) rr}rrPr\rrr#r{rZryr)rrr'Z statetyper r r rxs0    zLexerReflect.get_statesc Cs,dd|jD}i|_i|_i|_i|_i|_i|_|jD]}g|j|<g|j|<q:t|dkrv|j dd|_ dS|D]d}|j|}t ||j\}}||j|<t |drD|dkr|D]}||j|<qnt|dkr|D]}||j|<qnV|d kr"|j j}|j j}|j d |||jd|_ n |D]}|j|||fq&qzt|tr|d kr|D]}||j|<q^d |kr|j d |n@|dkr|j d |d|_ n |D]}|j|||fqqz|j d|d|_ qz|jD]}|jdddq|jD]}|jddddqdS)NcSs g|]}|dddkr|qS)NrZt_r ).0rr r r sz*LexerReflect.get_rules..rz+No rules of the form t_rulename are definedTr)r#rignorez,%s:%d: Rule '%s' must be defined as a string\z#%s contains a literal backslash '\''Rule '%s' must be defined as a functionz&%s not defined as a function or stringcSs |djjSNr-)rrxr r r z(LexerReflect.get_rules..)rJcSs t|dSr)r{rr r r rr)rJreverse)rrfuncsymstrsymrerrorfeoffrr{rr#rhasattrrrrr rFrPryr"rsort) rZtsymbolsrrrrtoknamelinefiler r r rsb              zLexerReflect.get_rulesc Csz|jD]T}|j|D]l\}}|jj}|jj}t|}|j||j |}t |t j rbd}nd}|jj } | |kr|jd|||jd|_q| |kr|jd|||jd|_qt|s|jd|||jd|_qzDtd|t|f|j} | dr|jd |||jd|_Wqtjk r} zB|jd |||j| d t|krl|jd |||jd|_W5d} ~ XYqXq|j|D]\} } |j | }|d kr|jd| d|_q||jkr|ddkr|jd| |d|_qz:td| | f|j} | dr2|jd| d|_WnTtjk r} z2|jd| | d | krr|jd| d|_W5d} ~ XYnXq|j|s|j|s|jd|d|_|j|d}|r|}|jj}|jj}t|}|j|t |t j r d}nd}|jj } | |kr:|jd|||jd|_| |kr|jd|||jd|_q|jD]}||qddS)Nrr-z'%s:%d: Rule '%s' has too many argumentsTz%%s:%d: Rule '%s' requires an argumentz2%s:%d: No regular expression defined for rule '%s' (?P<%s>%s)r,z<%s:%d: Regular expression for rule '%s' matches empty stringz3%s:%d: Invalid regular expression for rule '%s'. %s#z6%s:%d. Make sure '#' in rule '%s' is escaped with '\#'r#rrrz-Rule '%s' defined for an unspecified token %sz5Regular expression for rule '%s' matches empty stringz,Invalid regular expression for rule '%s'. %sz/Make sure '#' in rule '%s' is escaped with '\#'zNo rules defined for state '%s')rrrrrinspect getmodulernaddrrPrQr co_argcountrr#r rrrrsrrrrrrr}validate_module)rrfnamerrrmodulerZreqargsnargsrIer'rZefuncr r r rs                zLexerReflect.validate_rulesc Cszt|\}}Wntk r(YdSXtd}td}i}|d7}|D]n}||}|sj||}|r|d} || } | s||| <n$t|} |j d| || | d|_ |d7}qNdS)Nz\s*def\s+(t_[a-zA-Z_0-9]*)\(z\s*(t_[a-zA-Z_0-9]*)\s*=r-z7%s:%d: Rule %s redefined. Previously defined on line %dT) rgetsourcelinesrSrrrsrrr} getsourcefilerr#) rrlinesZlinenZfreZsreZ counthashrrr'prevrbr r r r@s*        zLexerReflect.validate_module)Nr)r r rr rrrrrrrrrrr r r r r.s   BgrFr`c % sr|dkr d}d} ddi} t} || _| dkr6ttj} |rL|dkrLttj}|rT|rfddtD} t| } d| krtj| dj| d<nt d} | d }|rt |t rd |kr|d |}t | | |d }||s|rtd |r8|r8z"| || | ja| ja| a| WStk r6YnX|rh|d |j|d|j|d|jt| _|jD]}| j|qvt |jttfrt|jd |j| _!n|j| _!| jt| j!B| _"|j} i}| D]}g}|j#|D]J\}}|j$j%}|j$j&}|'d|t(|f|r|d|t(||q|j)|D]2\}}|'d||f|rH|d|||qH|||<q|r|d|D]h}t*|||| |j+\}}}|| j,|<|| j-|<|| j.|<|rt/|D]\}}|d|||qq| 0D]`\}}|dkr|dkr| j,|1| j,d| j-|1| j-d| j.|1| j.dq| | _2| j,d| _3| j-d| _4|| _5|j6| _7| j7 dd| _8|j9| _:|j9 dd| _;| j;s| |j= dd| _?| 0D]\} }|dkrB| |j9kr | .__file__r r __package__rM)rrzCan't build lexerzlex: tokens = %rzlex: literals = %rzlex: states = %rrrz(lex: Adding rule %s -> '%s' (state '%s')z#lex: ==== MASTER REGEXS FOLLOW ====z"lex: state '%s' : regex[%d] = '%s'r,zNo t_error rule is definedrz1No error rule is defined for exclusive state '%s'z2No ignore rule is defined for exclusive state '%s'rNrkz#Couldn't write lextab module %r. %s)Jr*rBrrmrdirdictrnrrr}rPrrrr SyntaxErrorrxrr|rror$rrrrpr>rrr\rrWr@rqrrrrrFrrrrr0r1r2rrEextendr5r.r/r9rr6r?rr7r<r"rr8r=rQrRrTrlrGrUrVdirnamerjrS)%rrHr%optimizer`rZnowarnraZdebuglogZerrorlogrrZlexobjZ_itemspkgZlinforZregexsrZ regex_listrrrrr'rr.Zre_textZre_namesrrstypersrcfilerpkgnamerr rr lex_s                            $rcCs|sVz&tjd}t|}|}|Wn*tk rTtjdtj}YnX|rb|j }nt }|||rz|j }nt }|}|sqtjd|j |j |j |jfq~dS)Nr-z/Reading from standard input (type EOF to end): z(%s,%r,%d,%d) )rmargvrXreadclose IndexErrorstdoutrstdinr|rrrrr)rdatarbr_input_tokenrr r r runmains(   rcsfdd}|S)Ncs tdrt|_n|_|S)Nr))rrrrrr r set_regexBs  zTOKEN..set_regexr )rrr rr TOKENAs r)NN)$rYr[rrrmrQrDrUrZ StringTypeZ UnicodeTyperyAttributeErrorrbytesrsrrrrHrrr&r*rrr_rtrrrrVERBOSErrrTokenr r r r "sN  F  (3  A " ply/__pycache__/yacc.cpython-38.pyc000064400000147474147205113120013144 0ustar00U afk @sddlZddlZddlZddlZddlZddlZddlZdZdZ dZ dZ dZ dZ dZdZd ZdZejddkrteZneZejZGd d d eZGd d d eZGdddeZddZddZdada da!dZ"ddZ#ddZ$ddZ%ddZ&GdddZ'Gdd d Z(Gd!d"d"Z)e*d#Z+Gd$d%d%eZ,Gd&d'd'eZ-Gd(d)d)eZ.d*d+Z/Gd,d-d-eZ0Gd.d/d/eZ1Gd0d1d1eZ2Gd2d3d3eZ3d4d5Z4d6d7Z5Gd8d9d9eZ6Gd:d;d;e3Z7dd?Z9Gd@dAdAeZ:de de dddde ddddf dBdCZ;dS)DNz3.10Tz parser.outparsetabLALRF(c@s4eZdZddZddZeZddZddZeZd S) PlyLoggercCs ||_dSN)f)selfrr C/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/ply/yacc.py__init__nszPlyLogger.__init__cOs|j||ddS)N rwriter msgargskwargsr r r debugqszPlyLogger.debugcOs|jd||ddS)Nz WARNING: r rrr r r warningvszPlyLogger.warningcOs|jd||ddS)NzERROR: r rrr r r erroryszPlyLogger.errorN) __name__ __module__ __qualname__r rinforrcriticalr r r r rms rc@seZdZddZddZdS) NullLoggercCs|Srr )r namer r r __getattribute__szNullLogger.__getattribute__cOs|Srr )r rrr r r __call__szNullLogger.__call__N)rrrrrr r r r rsrc@s eZdZdS) YaccErrorNrrrr r r r r sr cCsPt|}d|krt|}t|tkr4|dtd}dt|jt||f}|S)Nr z ...z<%s @ 0x%x> (%s))reprlen resultlimittyperid)rrepr_strresultr r r format_results r*cCsBt|}d|krt|}t|dkr(|Sdt|jt|fSdS)Nr z <%s @ 0x%x>)r"r#r%rr&)r'r(r r r format_stack_entrys  r,aPLY: Don't use global functions errok(), token(), and restart() in p_error(). Instead, invoke the methods on the associated parser instance: def p_error(p): ... # Use parser.errok(), parser.token(), parser.restart() ... parser = yacc.yacc() cCstttSr)warningswarn_warnmsg_errokr r r r erroks r1cCstttSr)r-r.r/_restartr r r r restarts r3cCstttSr)r-r.r/_tokenr r r r tokens r5cCs>|ja|ja|ja||}z bbbWntk r8YnX|Sr)r1r0r5r4r3r2 NameError) errorfuncr5parserr'r r r call_errorfuncs r9c@seZdZddZddZdS) YaccSymbolcCs|jSrr%r r r r __str__szYaccSymbol.__str__cCst|Srstrr<r r r __repr__szYaccSymbol.__repr__N)rrrr=r@r r r r r:sr:c@sfeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ dS)YaccProductionNcCs||_||_d|_d|_dSr)slicestacklexerr8)r srCr r r r szYaccProduction.__init__cCsBt|trdd|j|DS|dkr2|j|jS|j|jSdS)NcSsg|] }|jqSr value.0rEr r r sz.YaccProduction.__getitem__..r) isinstancerBrGrCr nr r r __getitem__s   zYaccProduction.__getitem__cCs||j|_dSr)rBrG)r rMvr r r __setitem__szYaccProduction.__setitem__cCsdd|j||DS)NcSsg|] }|jqSr rFrHr r r rJsz/YaccProduction.__getslice__..)rB)r ijr r r __getslice__szYaccProduction.__getslice__cCs t|jSr)r#rBr<r r r __len__szYaccProduction.__len__cCst|j|ddS)NlinenorgetattrrBrLr r r rUszYaccProduction.linenocCs||j|_dSr)rBrU)r rMrUr r r set_linenoszYaccProduction.set_linenocCs,t|j|dd}t|j|d|}||fS)NrUr endlinenorV)r rM startlineendliner r r linespanszYaccProduction.linespancCst|j|ddS)NlexposrrVrLr r r r] szYaccProduction.lexposcCs,t|j|dd}t|j|d|}||fS)Nr]r endlexposrV)r rMstartposendposr r r lexspanszYaccProduction.lexspancCstdSr) SyntaxErrorr<r r r rszYaccProduction.error)N)rrrr rNrPrSrTrUrXr\r]rarr r r r rAs rAc@s\eZdZddZddZddZddZd d Zdd dZdddZ dddZ dddZ d S)LRParsercCs0|j|_|j|_|j|_||_|d|_dSNT) lr_productions productions lr_actionactionlr_gotogotor7set_defaulted_stateserrorok)r ZlrtabZerrorfr r r r s zLRParser.__init__cCs d|_dSrd)rlr<r r r r1&szLRParser.errokcCs@|jdd=|jdd=t}d|_|j||jddS)N$endr) statestacksymstackr:r%append)r symr r r r3)s    zLRParser.restartcCsPi|_|jD]:\}}t|}t|dkr|ddkr|d|j|<qdSNr)defaulted_statesrhitemslistvaluesr#)r stateactionsrulesr r r rk9s  zLRParser.set_defaulted_statescCs i|_dSr)rtr<r r r disable_defaulted_states@sz!LRParser.disable_defaulted_statesNFcCsZ|str.t|trttj}||||||S|rD||||||S||||||SdSr) yaccdevelrKintrsysstderr parsedebugparseoptparseopt_notrack)r inputrDrtracking tokenfuncr r r parseCs  zLRParser.parsec Csd}g}|j}|j} |j} |j} td} d} |d|sLddlm}|j}|| _|| _ |dk rj| ||dkrz|j }n|}||_ g}||_ g}||_ || _d}|dt}d|_||d}|d|d||| kr(|s|s|}n|}|st}d|_|j}|||}n| |}|d|| |d d d d d |Dddt|f|dk r|dkr|||}|d|||d}| r| d8} q|dkrH| | }|j}|j}t}||_d|_|r<|d|jdddd || dDd| |d||n|d|jg| |d||r|| dd}||d<|r|d}|j|_|j|_|d}t|d|j|_t|d|j|_|| _ zd|| d=||_!|"| || d=|dt#| d||| |d|}||Wqt$k r|||%|dd||d}d|_d|_|}t&} d|_'YqXqn|r|j|_|j|_|g}|| _ zL||_!|"| |dt#| d||| |d|}||Wqt$k rD||||d}d|_d|_|}t&} d|_'YqXq|dkr|d}t|dd}|dt#||d|S|dkr|(dd d dd |Dddt|f| dks|j'rt&} d|_'|}|jdkrd}|j)r:|rt*|ds||_||_!t+|j)||}|j'r|}d}qn`|rt*|d rT|j}nd}|rvt,j-.d!||jfnt,j-.d"|jnt,j-.d#dSnt&} t|dkr|jdkrd}d}d}|dd=q|jdkrdS|jdkr|d}|jdkr.|r(t|d |j|_t|d$|j|_d}qt}d|_t*|d rT|j|_|_t*|d$rn|j|_|_||_|||}q|}|r|j|_|j|_||d}qt/d%qdS)&NrzPLY: PARSE DEBUG STARTrslexrmz State : %sz#Defaulted state %s: Reduce using %dz Stack : %sz%s . %s cSsg|] }|jqSr r;rIZxxr r r rJsz'LRParser.parsedebug..z Action : Shift and goto state %sz3Action : Reduce rule [%s] with %s and goto state %d[,cSsg|]}t|jqSr )r,rG)rIZ_vr r r rJs]rYr^z Result : %srFrGzDone : Returning %szPLY: PARSE DEBUG ENDz Error : %scSsg|] }|jqSr r;rr r r rJBsrDrU(yacc: Syntax error at line %d, token=%s yacc: Syntax error, token=%s yacc: Parse error in input. EOF r]yacc: internal parser error!!! )0rhrjrfrtrArrrrDr8rr5rnrorCrpr:r%rpopgetjoinr?lstriprr#rGrUr]rWrYr^rBrxcallabler*rbextend error_countrlrr7hasattrr9r~rr RuntimeError r rrDrrr lookaheadlookaheadstackryrjprodrtpslice errorcountr get_tokenrnroerrtokenrqrxltypetppnameplentargt1rMr)tokrUr r r r\s        *        $               *          zLRParser.parsedebugc Csnd}g}|j}|j} |j} |j} td} d} |sBddlm}|j}|| _|| _|dk r`| ||dkrp|j }n|}||_ g}||_ g}||_ || _ d}|dt}d|_||d}|| kr|s|s|}n|}|st}d|_|j}|||}n| |}|dk rd|dkrJ|||}||d}| r| d8} q|dkrB| | }|j}|j}t}||_d|_|r|| dd}||d<|r|d}|j|_|j|_|d}t|d|j|_t|d|j|_|| _zP|| d=||_|| || d=||| |d|}||Wqtk r||||dd||d}d|_d|_|}t } d |_!YqXqn|r|j|_|j|_|g}|| _z8||_|| ||| |d|}||Wqtk r>||||d}d|_d|_|}t } d |_!YqXq|dkrd|d}t|d d}|S|dkr`| dks|j!rHt } d |_!|}|jdkrd}|j"r|rt#|d s||_||_t$|j"||}|j!rF|}d}qn`|r6t#|d r|j}nd}|r"t%j&'d ||jfnt%j&'d|jnt%j&'ddSnt } t|dkr~|jdkr~d}d}d}|dd=q|jdkrdS|jdkr0|d}|jdkr|rt|d |j|_t|d|j|_d}qt}d|_t#|d r|j|_|_t#|dr|j|_|_||_|||}q|}|rN|j|_|j|_||d}qt(dqdS)NrrsrrmrrYr^rFrGrDrUrrrr]r))rhrjrfrtrArrrDr8rr5rnrorCrpr:r%rrrr#rGrUr]rWrYr^rBrxrrbrrrlr7rr9r~rrrrr r r rsV                                  zLRParser.parseoptcCsd}g}|j}|j} |j} |j} td} d} |sBddlm}|j}|| _|| _|dk r`| ||dkrp|j }n|}||_ g}||_ g}||_ || _ d}|dt}d|_||d}|| kr|s|s|}n|}|st}d|_|j}|||}n| |}|dk r|dkrJ|||}||d}| r| d8} q|dkr| | }|j}|j}t}||_d|_|rT|| dd}||d<|| _zP|| d=||_|| || d=||| |d|}||Wqtk rN||||dd||d}d|_d|_|}t} d|_YqXqn|g}|| _z8||_|| ||| |d|}||Wqtk r||||d}d|_d|_|}t} d|_YqXq|dkr|d}t|dd}|S|dkr| dks$|jrt} d|_|}|jdkrBd}|jr|rbt|d sb||_||_t |j||}|jr|}d}qn`|rt|d r|j!}nd}|rt"j#$d ||jfnt"j#$d |jnt"j#$d dSnt} t|dkr"|jdkr"d}d}d}|dd=q|jdkr2dS|jdkr|d}|jdkrXd}qt}d|_t|d r~|j!|_!|_%t|dr|j&|_&|_'||_|||}q|}||d}qt(dqdS)NrrsrrmrrFrGrDrUrrrr]r))rhrjrfrtrArrrDr8rr5rnrorCrpr:r%rrrr#rGrBrxrrbrrrlrWr7rr9rUr~rrrYr]r^r)r rrDrrrrrryrjrrtrrrrrnrorrqrxrrrrrrrMr)rrUr r r rs6                                  zLRParser.parseopt_notrack)NNFFN)NNFFN)NNFFN)NNFFN) rrrr r1r3rkr{rrrrr r r r rcs  ] 4rcz^[a-zA-Z0-9_-]+$c@sReZdZdZdddZddZd d Zd d Zd dZddZ ddZ ddZ dS) ProductionrrightrNrc Cs||_t||_||_||_d|_||_||_||_t |j|_ g|_ |jD]}||j krL|j |qLg|_ d|_ |jrd|jd|jf|_n d|j|_dSN%s -> %srz %s -> )rtuplernumberfuncrfilelineprecr#usymsrplr_itemslr_nextrr?) r rrr precedencerrrrEr r r r s$    zProduction.__init__cCs|jSrr>r<r r r r==szProduction.__str__cCsdt|dS)Nz Production()r>r<r r r r@@szProduction.__repr__cCs t|jSr)r#rr<r r r rTCszProduction.__len__cCsdSNrsr r<r r r __nonzero__FszProduction.__nonzero__cCs |j|Sr)rr indexr r r rNIszProduction.__getitem__c Cs|t|jkrdSt||}zt|j|d|_Wnttfk rRg|_YnXz|j|d|_Wntk rd|_YnX|Sr)r#rLRItem Prodnameslr_after IndexErrorKeyError lr_before)r rMrr r r lr_itemMs   zProduction.lr_itemcCs|jr||j|_dSrrrr pdictr r r bind]szProduction.bind)rNrr) rrrreducedr r=r@rTrrNrrr r r r rs rc@s,eZdZddZddZddZddZd S) MiniProductioncCs.||_||_||_d|_||_||_||_dSr)rr#rrrrr?)r r?rr#rrrr r r r fszMiniProduction.__init__cCs|jSrr>r<r r r r=oszMiniProduction.__str__cCs d|jS)NzMiniProduction(%s)r>r<r r r r@rszMiniProduction.__repr__cCs|jr||j|_dSrrrr r r rvszMiniProduction.bindN)rrrr r=r@rr r r r res rc@s$eZdZddZddZddZdS)rcCsZ|j|_t|j|_|j|_||_i|_|j|dt|j|_t|j|_|j |_ dS)N.) rrvrrlr_index lookaheadsinsertrr#r)r rrMr r r r s   zLRItem.__init__cCs,|jrd|jd|jf}n d|j}|Sr)rrr)r rEr r r r=s zLRItem.__str__cCsdt|dS)NzLRItem(rr>r<r r r r@szLRItem.__repr__N)rrrr r=r@r r r r rs rcCs6t|d}|dkr2|||kr(||S|d8}q dSrr)r#)symbols terminalsrQr r r rightmost_terminals    rc@s eZdZdS) GrammarErrorNr!r r r r rsrc@seZdZddZddZddZddZd$d d Zd%ddZddZ ddZ ddZ ddZ ddZ ddZddZddZd&d d!Zd"d#Zd S)'GrammarcCsbdg|_i|_i|_i|_|D]}g|j|<qg|jd<i|_i|_i|_i|_t|_ d|_ dSNr) ProductionsrProdmap Terminals NonterminalsFirstFollow PrecedencesetUsedPrecedenceStart)r rtermr r r r s  zGrammar.__init__cCs t|jSr)r#rr<r r r rTszGrammar.__len__cCs |j|Sr)rrr r r rNszGrammar.__getitem__cCsL|jdgkstd||jkr*td||dkr:td||f|j|<dS)Nz2Must call set_precedence() before add_production()z,Precedence already specified for terminal %r)leftrnonassocz:Associativity must be one of 'left','right', or 'nonassoc')rAssertionErrorrr)r rassoclevelr r r set_precedences   zGrammar.set_precedenceNrrc Cs||jkrtd|||f|dkr6td|||ft|sRtd|||ft|D]\}}|ddkrzLt|}t|dkrtd||||f||jkrg|j|<|||<WqZWntk rYnXt|sZ|d krZtd ||||fqZd |kr|d d kr td ||f|d d kr>td||f|d } |j | } | sltd||| fn |j | |d d=nt ||j} |j | d} d||f} | |j kr|j | } td||| fd| j| jft|j} ||jkrg|j|<|D]J}||jkr(|j|| n&||jkr>g|j|<|j|| qt| ||| |||}|j|||j | <z|j||Wn"tk r|g|j|<YnXdS)Nz7%s:%d: Illegal rule name %r. Already defined as a tokenrz5%s:%d: Illegal rule name %r. error is a reserved wordz%s:%d: Illegal rule name %rrz'"rszA%s:%d: Literal token %s in rule %r may only be a single characterz%precz!%s:%d: Illegal name %r in rule %rrz+%s:%d: Syntax error. Nothing follows %%preczH%s:%d: Syntax error. %%prec can only appear at the end of a grammar rulez/%s:%d: Nothing known about the precedence of %rrrz%s:%d: Duplicate rule %s. zPrevious definition at %s:%d)rr_is_identifiermatch enumerateevalr#rbrrraddrrrrrrrprrr)r prodnamesymsrrrrMrEcZprecnameZprodprecmapmZpnumberrrr r r add_production sv                       zGrammar.add_productioncCsT|s|jdj}||jkr&td|tdd|g|jd<|j|d||_dS)Nrszstart symbol %s undefinedrS')rrrrrrpr)r startr r r set_startas   zGrammar.set_startcs>fddtjdjdfddjDS)NcsB|kr dS|j|gD]}|jD] }|q.q$dSr)rrrr)rErr'mark_reachable_from reachabler r r rts   z5Grammar.find_unreachable..mark_reachable_fromrcsg|]}|kr|qSr r rH)rr r rJ~sz,Grammar.find_unreachable..)rrrrr<r rr find_unreachableqszGrammar.find_unreachablec Csi}|jD] }d||<q d|d<|jD] }d||<q&d}|jD]N\}}|D]@}|jD]}||sXd}qrqXd}|rN||sd||<d}qBqNqB|s4qq4g} |D]4\}} | s||jkr||jkr|dkrq| |q| S)NTrmFr)rrrrurrp) r Z terminatesrrM some_changeplrrEZ p_terminatesinfiniterr r r infinite_cycless8      zGrammar.infinite_cyclescCsPg}|jD]@}|sq |jD].}||jkr||jkr|dkr|||fqq |Sr)rrrrrp)r r)rrEr r r undefined_symbolss  zGrammar.undefined_symbolscCs2g}|jD]\}}|dkr|s||q|Sr)rrurp)r Z unused_tokrErOr r r unused_terminalss   zGrammar.unused_terminalscCs8g}|jD]$\}}|s|j|d}||q|SNr)rrurrp)r Z unused_prodrErOrr r r unused_ruless  zGrammar.unused_rulescCs@g}|jD]0}||jks ||jks |||j|dfq |Sr)rrrrp)r ZunusedZtermnamer r r unused_precedences  zGrammar.unused_precedencecCsZg}|D]B}d}|j|D]$}|dkr,d}q||kr||q|rFqqVq|d|S)NFT)rrp)r betar)xZx_produces_emptyrr r r _first s  zGrammar._firstcCs|jr |jS|jD]}|g|j|<qdg|jd<|jD]}g|j|<q6d}|jD]H}|j|D]8}||jD]&}||j|krn|j||d}qnq^qP|sFqqF|jS)NrmFT)rrrrrrrp)r rrMrrrr r r compute_first,s"      zGrammar.compute_firstc Cs<|jr |jS|js||jD]}g|j|<q |s@|jdj}dg|j|<d}|jddD]}t|jD]\}}||jkrl||j|dd}d}|D]:} | dkr| |j|kr|j| | d}| dkrd}q|s|t |jdkrl|j|jD]*} | |j|kr|j| | d}qqlq^|sLq6qL|jS)NrsrmFrT) rrr rrrrrrrpr#) r rkdidaddrrQBZfstZhasemptyrr r r compute_followQs:      zGrammar.compute_followc Cs|jD]}|}d}g}|t|kr(d}ntt||}z|j|j|d|_Wnttfk rjg|_YnXz|j|d|_Wntk rd|_YnX||_ |sq| ||}|d7}q||_ qdSNrrs) rr#rrrrrrrrrpr)r rZlastlrirQrZlrir r r build_lritemss,       zGrammar.build_lritems)Nrr)N)N)rrrr rTrNrrrrrrrrrrr r rr r r r rs $  T @#% ;rc@s eZdZdS) VersionErrorNr!r r r r rsrc@s,eZdZddZddZddZddZd S) LRTablecCsd|_d|_d|_d|_dSr)rgrire lr_methodr<r r r r szLRTable.__init__cCszt|tjr|}ntd|tj|}|jtkr:td|j |_ |j |_ g|_ |jD]}|j t|qV|j|_|jS)N import %s&yacc table file version is out of date)rKtypes ModuleTypeexecr~modulesZ _tabversion__tabversion__rZ _lr_actionrgZ_lr_gotorireZ_lr_productionsrprZ _lr_methodrZ _lr_signature)r modulerrr r r read_tables     zLRTable.read_tablecCsz ddl}Wntk r(ddl}YnXtj|s:tt|d}||}|tkr^t d|||_ ||}|||_ |||_ ||}g|_ |D]}|j t|q||S)Nrrbr)cPickle ImportErrorpickleospathexistsopenloadrrrrgrirerprclose)r filenamerZin_fZ tabversion signaturerfrr r r read_pickles(         zLRTable.read_picklecCs|jD]}||qdSr)rer)r rrr r r bind_callabless zLRTable.bind_callablesN)rrrr rr(r)r r r r rsrc CsLi}|D] }d||<qg}i}|D]$}||dkr"t|||||||q"|Sr)traverse)XRFPNrrCFr r r digraphs  r0c Cs||t|}|||<||||<||}|D]f} || dkrVt| ||||||t|||| ||<|| gD]} | ||krx||| qxq2|||krt||d<||||d<|} | |krt||d<||||d<|} qdS)Nrr)rpr#r*minrMAXINTr) rr.rCr/r+r,r-drelyaelementr r r r*s(       r*c@s eZdZdS) LALRErrorNr!r r r r r8)sr8c@seZdZd$ddZddZddZd d Zd d Zd dZddZ ddZ ddZ ddZ ddZ ddZddZddZd%d d!Zd&d"d#ZdS)'LRGeneratedTablerNcCs|dkrtd|||_||_|s*t}||_i|_i|_|j|_i|_ i|_ d|_ d|_ d|_ g|_g|_g|_|j|j|j|dS)N)ZSLRrzUnsupported method %sr)r8grammarrrlogrgrirre lr_goto_cache lr0_cidhash _add_countZ sr_conflictZ rr_conflict conflicts sr_conflicts rr_conflictsrr r lr_parse_table)r r:methodr;r r r r 4s,    zLRGeneratedTable.__init__cCsn|jd7_|dd}d}|rjd}|D]<}|jD]0}t|dd|jkrLq4||j|j|_d}q4q*q|S)NrsTF lr0_addedr)r>rrWrprrD)r IJr rRrr r r lr0_closureYs    zLRGeneratedTable.lr0_closurec Cs|jt||f}|r|S|j|}|s:i}||j|<g}|D]H}|j}|rB|j|krB|t|}|s|i}||t|<|||}qB|d}|s|r||}||d<n||d<||jt||f<|S)Nrm)r<rr&rrrprG) r rErgrEZgsrrMs1r r r lr0_gotoss2       zLRGeneratedTable.lr0_gotoc Cs||jjdjgg}d}|D]}||jt|<|d7}q d}|t|kr||}|d7}i}|D]}|jD] }d||<qnqd|D]@}|||}|rt||jkrqt||jt|<| |qq@|Sr) rGr:rrr=r&r#rrJrp) r CrQrEZasymsiirErrHr r r lr0_itemss(     zLRGeneratedTable.lr0_itemscCsxt}d}|jjddD]@}|jdkr6||jq|jD]}||kr<qq<||jqt||krjqtt|}q |Sr)rr:rr#rrr)r nullableZ num_nullablerrr r r compute_nullable_nonterminalss     z.LRGeneratedTable.compute_nullable_nonterminalscCsjg}t|D]X\}}|D]J}|j|jdkr||j|jdf}|d|jjkr||kr||qq |Sr)rrr#rr:rrp)r rKtransZstatenorxrrr r r find_nonterminal_transitionssz-LRGeneratedTable.find_nonterminal_transitionsc Csi}|\}}g}||||}|D]B} | j| jdkr$| j| jd} | |jjkr$| |kr$|| q$|dkr||jjdjdkr|d|S)Nrsrrm)rJrr#rr:rrpr) r rKrPrNZdr_setrxr.termsrHrr6r r r dr_relations   zLRGeneratedTable.dr_relationc Csrg}|\}}||||}|jt|d}|D]:} | j| jdkr2| j| jd} | |kr2||| fq2|S)Nrrs)rJr=rr&rr#rrp) r rKrPemptyr4rxr.rHrRrr6r r r reads_relation szLRGeneratedTable.reads_relationcCsi}i}i}|D] }d||<q|D]\}} g} g} ||D],} | j| krNq<| j} |}| | jdkr| d} | j| }||f|kr| d}|| jkr| j||jjkrq| j||krq|d}q| ||f||||}|j t |d}qX||D]j}|j| jkrq|j| jkr"qd}||jkrZ|j|| j|dkrNq|d}q&| ||fqq<| D]*}||krg||<|||| fqp| ||| f<q"||fS)Nrsrr) rrr#rr:rrprJr=rr&)r rKrPrNZlookdictZ includedictZdtransrrxr.ZlookbincludesrrrRlirHr'rQr r r compute_lookback_includesC sX          z*LRGeneratedTable.compute_lookback_includescs0fdd}fdd}t|||}|S)Ncs|Sr)rSrrKrNr r r  z4LRGeneratedTable.compute_read_sets..cs|Sr)rUrYrZr r r[ r\r0)r rKntransrNr-r,r/r rZr compute_read_sets s z"LRGeneratedTable.compute_read_setscs(fdd}fdd}t|||}|S)Ncs|Srr rY)readsetsr r r[ r\z6LRGeneratedTable.compute_follow_sets..cs |gSr)rrY)inclsetsr r r[ r\r])r r^r`rar-r,r/r )rar`r compute_follow_sets s   z$LRGeneratedTable.compute_follow_setsc Csl|D]^\}}|D]P\}}||jkr0g|j|<||g}|D]"}||j|kr@|j||q@qqdSr)rurrrp) r Z lookbacksZ followsetrPZlbrxrrr6r r r add_lookaheads s    zLRGeneratedTable.add_lookaheadscCsP|}||}||||}||||\}}||||}|||dSr)rOrQr_rXrbrc)r rKrNrPr`ZlookdZincludedZ followsetsr r r add_lalr_lookaheads s  z$LRGeneratedTable.add_lalr_lookaheadsc$ Cs|jj}|jj}|j}|j}|j}i}|d|j|}|jdkrP| |d}|D]} g} i} i} i} |d|d||d| D]}|d|j |q|d| D]}|j |j dkr|j dkrd| d <|| d <q|jdkr|j|}n|jj|j }|D]}| ||d |j |ff| |}|dk r|dkr*||d \}}||j j\}}||ks||kr|d kr|j | |<|| |<|s|s|d ||j||df||j jd7_nB||kr|dkrd| |<n$|s|d||j||dfn|dkr|| }||j }|j|jkr|j | |<|| |<||}}||j jd7_||j jd8_n ||}}|j|||f|d|| |j | |n td|n(|j | |<|| |<||j jd7_qq|j }|j|d}||jjkr|| |}|jt|d}|dkr| ||d|f| |}|dk r|dkr||krtd|n|dkr||d \}}|| |j j\}}||ks||kr<|dkr<|| |j jd8_|| |<|| |<|s|d||j||dfnH||krZ|dkrZd| |<n*|s|s|d ||j||dfn td|q|| |<|| |<qi}| D]>\}}}|| kr|| |kr|d||d|||f<q|dd}| D]P\}}}|| kr|| |k r||f|kr|d||d}d|||f<q|rb|di} | D]*}!|!jD]}"|"|jjkrtd| |"<qtqj| D]D}#|| |#}|jt|d}|dkr|| |#<|d|#|q| ||<| ||<| ||<|d7}qXdS)NzParsing method: %srrrzstate %dz (%d) %srsrrmzreduce using rule %d (%s)rrz3 ! shift/reduce conflict for %s resolved as reducereducerz2 ! shift/reduce conflict for %s resolved as shiftshiftz= ! reduce/reduce conflict for %s resolved using rule %d (%s)zUnknown conflict in state %drzshift and go to state %dz Shift/shift conflict in state %drz %-15s %sz ! %-15s [ %s ]z" %-30s shift and go to state %d) r:rrrirgr;rrrMrdrr#rrrrrprrr@rrrAr8rrrJr=r&rrr)$r rrrjrhr;ZactionprKstrEZactlistZ st_actionZ st_actionpZst_gotorZlaheadsr6r'ZsprecZslevelZrprecZrlevelZoldpppZchosenpZrejectprQrHrRZ _actprintrZnot_usedZnkeysrLrErMr r r rB s                                               zLRGeneratedTable.lr_parse_tablerc Cst|tjrtd|dd}tj||d}z8t|d}| dtj |t |j |fd}|r`i}|j D]T\} } | D]B\} } || } | sggf} | || <| d| | d| qqz| d |D]f\}} | d || dD]} | d | q| d | dD]} | d | q(| d q| d| dnF| d|j D]&\}} | d|d|d| fqt| d|ri}|jD]Z\} } | D]F\} } || } | sggf} | || <| d| | d| qʐq| d|D]h\}} | d || dD]} | d | qF| d | dD]} | d | qn| d q(| d| dnF| d|jD]&\}} | d|d|d| fq| d| d|jD]Z}|jr:| d|j|j|j|jtj |j|jfn| dt||j|jfq| d|Wn&tk r}zW5d}~XYnXdS)Nz"Won't overwrite existing tabmodulerrz.pywzu # %s # This file is automatically generated. Do not edit. _tabversion = %r _lr_method = %r _lr_signature = %r rsrz _lr_action_items = {z%r:([z%r,z],[z]),z} z _lr_action = {} for _k, _v in _lr_action_items.items(): for _x,_y in zip(_v[0],_v[1]): if not _x in _lr_action: _lr_action[_x] = {} _lr_action[_x][_k] = _y del _lr_action_items z _lr_action = { z (%r,%r):%r,z _lr_goto_items = {z _lr_goto = {} for _k, _v in _lr_goto_items.items(): for _x, _y in zip(_v[0], _v[1]): if not _x in _lr_goto: _lr_goto[_x] = {} _lr_goto[_x][_k] = _y del _lr_goto_items z _lr_goto = { z_lr_productions = [ z (%r,%r,%d,%r,%r,%d), z (%r,%r,%d,None,None,None), z] )rKrrIOErrorsplitr r!rr#rbasenamerrrgrurrprirerr?rr#rrr%)r tabmodule outputdirr'Zbasemodulenamer&rZsmallerrurEndrrOrQr rer r r write_table s                             zLRGeneratedTable.write_tablec Csz ddl}Wntk r(ddl}YnXt|d}|t|t||j|t|||t||j|t||j |tg}|j D]T}|j r| |j |j|j|j tj|j|jfq| t ||j|jdddfq|||tW5QRXdS)Nrwb)rrrr#dumprpickle_protocolrrgrirerrpr?rr#r r!rlrr)r r&r'routfZoutprr r r pickle_table s    , zLRGeneratedTable.pickle_table)rN)rr)r)rrrr rGrJrMrOrQrSrUrXr_rbrcrdrBrqrvr r r r r93s" %#8+PB zr9cCs0t|}|j}|j|jkr,||j|Sr)r~ _getframe f_globalscopyf_localsupdate)levelsrZldictr r r get_caller_module_dictC s     r}c Csg}|}d}|}|D]}|d7}|}|s2qz|ddkrf|sTtd||f|} |dd} n@|d} | }|dd} |d} | dkr| dkrtd||f|||| | fWqtk rYqtk rtd |||fYqXq|S) Nrsr|z%s:%d: Misplaced '|':z::=z!%s:%d: Syntax error. Expected ':'z%s:%d: Syntax error in rule %r) splitlinesrkrbrp Exceptionstrip) docrrr:ZpstringsZlastpZdlineZpsrrrZassignr r r parse_grammarO s6  rc@seZdZd ddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZddZddZdS)! ParserReflectNcCsL||_d|_d|_d|_t|_g|_d|_|dkrBtt j |_ n||_ dS)NF) rr error_functokensrrr:rrr~rr;)r rr;r r r r y szParserReflect.__init__cCs,|||||dSr) get_startget_error_func get_tokensget_precedenceget_pfunctionsr<r r r get_all s zParserReflect.get_allcCs6|||||||jSr)validate_startvalidate_error_funcvalidate_tokensvalidate_precedencevalidate_pfunctionsvalidate_modulesrr<r r r validate_all szParserReflect.validate_allc Csg}zr|jr||j|jr:|ddd|jD|jrR|d|j|jD]}|drX||dqXWnttfk rYnXd|S)NrcSsg|]}d|qS)r)r)rIrr r r rJ sz+ParserReflect.signature..rr)rrprrrpfuncs TypeError ValueError)r partsrr r r r' s  zParserReflect.signaturec Cstd}|jD]}zt|\}}Wntk r>YqYnXi}t|D]^\}}|d7}||}|rL|d}| |} | s|||<qLt |} |j d| ||| qLqdS)Nz\s*def\s+(p_[a-zA-Z_0-9]*)\(rsz;%s:%d: Function %s redefined. Previously defined on line %d) recompilerinspectgetsourcelinesrjrrgroupr getsourcefiler;r) r ZfrerlinesZlinenZ counthashrrrprevr&r r r r s,        zParserReflect.validate_modulescCs|jd|_dS)Nr)rrrr<r r r r szParserReflect.get_startcCs&|jdk r"t|jts"|jddS)Nz'start' must be a string)rrK string_typesr;rr<r r r r s  zParserReflect.validate_startcCs|jd|_dS)Np_error)rrrr<r r r r szParserReflect.get_error_funccCs|jrt|jtjrd}n*t|jtjr.d}n|jdd|_dS|jjj}|jjj }t |j}|j ||jjj|}|dkr|jd||d|_dS)Nrrsz2'p_error' defined, but is not a function or methodTz$%s:%d: p_error() requires 1 argument)rrKr FunctionType MethodTyper;r__code__co_firstlineno co_filenamer getmodulerr co_argcount)r ismethodZelineZefilerZargcountr r r r s      z!ParserReflect.validate_error_funccCsn|jd}|s&|jdd|_dSt|ttfsJ|jdd|_dS|sd|jdd|_dS||_dS)NrzNo token list is definedTztokens must be a list or tupleztokens is empty)rrr;rrKrvrr)r rr r r r s    zParserReflect.get_tokenscCsVd|jkr |jdd|_dSt}|jD]$}||krF|jd|||q,dS)Nrz.Illegal token name 'error'. Is a reserved wordTzToken %r multiply defined)rr;rrrr)r rrMr r r r s   zParserReflect.validate_tokenscCs|jd|_dS)Nr)rrrr<r r r r szParserReflect.get_precedencecCsg}|jrt|jttfs2|jdd|_dSt|jD]\}}t|ttfsj|jdd|_dSt|dkr|jd|d|_dS|d}t|ts|jdd|_dS|ddD]<}t|ts|jd d|_dS| |||dfqq<||_ dS) Nz"precedence must be a list or tupleTzBad precedence tablerz?Malformed precedence entry %s. Must be (assoc, term, ..., term)rz)precedence associativity must be a stringrsz precedence items must be strings) rrKrvrr;rrr#rrppreclist)r rrrrrr r r r s6       z!ParserReflect.validate_precedencecCsg}|jD]\\}}|dr|dkr*qt|tjtjfrt|d|jj }t |}| ||||j fq|jddd||_dS)Np_rrcSs |dt|d|d|dfS)Nrrsrrr>)Z p_functionr r r r[D s  z.ParserReflect.get_pfunctions..)key)rru startswithrKrrrrWrrrrrp__doc__sortr)r Z p_functionsritemrrr r r r7 s zParserReflect.get_pfunctionsc CsNg}t|jdkr(|jdd|_dS|jD]\}}}}t|}|j|}t|tj rbd}nd}|j j |kr|jd|||j d|_q.|j j |kr|jd|||j d|_q.|j s|jd|||j q.z(t|||} | D]} ||| fqWn:tk r4} z|jt| d|_W5d} ~ XYnX|j|q.|jD]\} } | d rzt| tjtj frzqN| d rqN| d r| d kr|jd | t| tjr| j j dkst| tj rN| jj j dkrN| j rNz8| j d }|ddkr&|jd| j j| j j| Wntk r>YnXqN||_dS)Nrz+no rules of the form p_rulename are definedTrrsz%%s:%d: Rule %r has too many argumentsz#%s:%d: Rule %r requires an argumentzA%s:%d: No documentation string specified in function %r (ignored)rZt_rz%r not defined as a functionrrz9%s:%d: Possible grammar rule %r defined without p_ prefix)r#rr;rrrrrKrrrrrrrrrprbr?rrrurr__func__rkrrrr:)r r:rrrrrrZreqargsZparsed_grHrprMrOr r r rL sn             z!ParserReflect.validate_pfunctions)N)rrrr rrr'rrrrrrrrrrrr r r r rx s  rc < s0 |dkr t}| rd}| dkr&ttj} rffddtD} t| }d|krntj|dj|d<ntd}| dkrt |t j r|j}nLd|kr|d}n:| d}d |dd}td |ttj|dd }tj|} |d }|rt |trd|kr|d|}|dk r&||d <t|| d }||jrJtd|}zt}| rl|| }n ||}|s||krz&||jt||j }|j!a!|WWSt"k r}z| #d|W5d}~XYnXWnFt$k r}z| #t|W5d}~XYnt%k r&YnX| dkr|rztt&tj | |d} Wn<t'k r}z| #d||ft(} W5d}~XYnXnt(} | )dt*d}|+rtd|j s| #dt,|j-}|j.D]P\}}}z|/|||Wn0t0k r*}z| #d|W5d}~XYnXq|j1D]b\}}|\} }!}"}#z|2|"|#|| |!Wn4t0k r}z| d|d}W5d}~XYnXq6z&|dkr|3|j4n |3|Wn6t0k r}z| t|d}W5d}~XYnX|rtd|5}$|$D]"\}%}&| d|&j6|&j7|%d}q|8}'|'r| )d | )d| )d |'D]}| #d|| )d|qf|r| )d | )d| )d t9|j:D]\}(})| )d|(|)q|;}*|*D]}&| #d|&j6|&j7|&j<qt=|'dkr| #dt=|'dkr.| #d t=|'t=|*dkrF| #d!t=|*dkrd| #d"t=|*|r4| )d | )d#| )d t>|j?}+|+@|+D]*}| )d$|d% d&d|j?|Dq| )d | )d'| )d t>|jA},|,@|,D]*}-| )d$|-d% d(d|jA|-Dq| )d |r~|B}.|.D]}/| #d)|/qF|C}0|0D]}1| d*|1d}qf|D}2|2D]\}}| d+||d}q|rtd|r| Ed,|tF||| }|rFt=|jG}3|3dkr| #d-n|3dkr| #d.|3t=|jH}4|4dkr0| #d/n|4dkrF| #d0|4|rp|jGs\|jHrp| #d | #d1| #d |jGD]\}5}6}7| #d2|6|5|7qtI}8|jHD]x\}5}9}:|5tJ|9tJ|:f|8krАq| #d3|5|9| #d4|:|5| #d3|5|9| #d4|:|5|8K|5tJ|9tJ|:fqg};|jHD]@\}5}9}:|:jLs.|:|;kr.| #d5|:| #d5|:|;M|:q.|rz|N|| |Wn6t'k r}z| #d6||fW5d}~XYnX| rz|O| |Wn6t'k r }z| #d6| |fW5d}~XYnX||jt||j }|j!a!|S)7Nrcsg|]}|t|fqSr )rW)rIr rr r rJ szyacc..__file__rrrrrr __package__r)r;zUnable to build parserz.There was a problem loading the table file: %rrizCouldn't open %r. %sz5Created by PLY version %s (http://www.dabeaz.com/ply)Fz no p_error() function is definedz%sTz;%s:%d: Symbol %r used, but not defined as a token or a rulezUnused terminals:zToken %r defined, but not usedz %srz Rule %-5d %sz$%s:%d: Rule %r defined, but not usedrszThere is 1 unused tokenzThere are %d unused tokenszThere is 1 unused rulezThere are %d unused rulesz'Terminals, with rules where they appearz %-20s : %srcSsg|] }t|qSr r>rHr r r rJG sz*Nonterminals, with rules where they appearcSsg|] }t|qSr r>rHr r r rJO szSymbol %r is unreachablez)Infinite recursion detected for symbol %rz0Precedence rule %r defined for unknown symbol %rzGenerating %s tablesz1 shift/reduce conflictz%d shift/reduce conflictsz1 reduce/reduce conflictz%d reduce/reduce conflictsz Conflicts:z7shift/reduce conflict for %s in state %d resolved as %sz;reduce/reduce conflict in state %d resolved using rule (%s)zrejected rule (%s) in state %dzRule (%s) is never reducedzCouldn't create %r. %s)P tab_modulerr~rdirdictrrr}rKrrrkrrrWr r!dirnamerr?rrrr r'rr(rr)rrcrrrrrrr#rjrr __version__rrrrrrr:rrrrrrrrrrrr#rvrrrrrrrr9r@rArr&rrrprqrv)>s   4m H.rT   ) ply/__pycache__/ygen.cpython-38.pyc000064400000003310147205113120013143 0ustar00U af@s:ddlZddlZddZddZddZedkr6edS) NcCsdt|}d|}d|}|D]\}}||rq8q|D]\}}||r<qXq<|d|fS)Nz #--! %s-startz #--! %s-end) enumeratestrip startswithendswith)linestagZsrclinesZ start_tagZend_tag start_indexlineZ end_indexr C/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/ply/ygen.pyget_source_range s  r cCsBg}d}d|}|D](}||r.| }q|r||q|S)NTz#--! %s)rrappend)rrZfiltered_linesincludeZtag_textr r r r filter_sections rc Cstjt}ttj|dtj|dttj|dd}|}W5QRXt |d\}}t |d\}}t |d\}}|||} t | d} t | d} | |||<| |||<d d |D}ttj|dd }| |W5QRXt d dS) Nzyacc.pyz yacc.py.bakrZ parsedebugZparseoptzparseopt-notrackDEBUGZTRACKINGcSsg|]}|dqS) )rstrip).0r r r r >szmain..wzUpdated yacc.py) ospathdirname__file__shutilcopy2joinopen readlinesr r writelinesprint) rfrZ parse_startZ parse_endZparseopt_startZ parseopt_endZparseopt_notrack_startZparseopt_notrack_endZ orig_linesZparseopt_linesZparseopt_notrack_linesr r r main's        r$__main__)os.pathrrr rr$__name__r r r r  s  __pycache__/__init__.cpython-38.pyc000064400000005014147205113120013137 0ustar00U aff @sFdddgZdZddlZddlmZddlmZdd d ZdddZdS)Zc_lexerc_parserZc_astz2.22N) check_output)CParsercppc Cs~|g}t|tr||7}n|dkr,||g7}||g7}zt|dd}Wn2tk rx}ztdd|W5d}~XYnX|S)ae Preprocess a file using cpp. filename: Name of the file you want to preprocess. cpp_path: cpp_args: Refer to the documentation of parse_file for the meaning of these arguments. When successful, returns the preprocessed file's contents. Errors from cpp will be printed out. rT)universal_newlineszAUnable to invoke 'cpp'. Make sure its path was passed correctly zOriginal error: %sN) isinstancelistrOSError RuntimeError)filenamecpp_pathcpp_args path_listtexterC/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/__init__.pypreprocess_files    rFc CsN|rt|||}n"tj||d}|}W5QRX|dkrBt}|||S)aD Parse a C file using pycparser. filename: Name of the file you want to parse. use_cpp: Set to True if you want to execute the C pre-processor on the file prior to parsing it. cpp_path: If use_cpp is True, this is the path to 'cpp' on your system. If no path is provided, it attempts to just execute 'cpp', so it must be in your PATH. cpp_args: If use_cpp is True, set this to the command line arguments strings to cpp. Be careful with quotes - it's best to pass a raw string (r'') here. For example: r'-I../utils/fake_libc_include' If several arguments are required, pass a list of strings. encoding: Encoding to use for the file to parse parser: Optional parser object to be used instead of the default CParser When successful, an AST is returned. ParseError can be thrown if the file doesn't parse successfully. Errors from cpp will be printed out. )encodingN)rioopenreadrparse)r Zuse_cpprrparserrrfrrr parse_file3s"r)rr)FrrNN) __all__ __version__r subprocessrrrrrrrrr s    !__pycache__/_ast_gen.cpython-38.pyc000064400000023631147205113120013164 0ustar00U af;)@s8ddlmZGdddeZGdddeZdZdZdS) )Templatec@s(eZdZd ddZd ddZddZdS) ASTCodeGenerator _c_ast.cfgcCs ||_dd||D|_dS)zN Initialize the code generator from a configuration file. cSsg|]\}}t||qS)NodeCfg).0namecontentsrrC/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/_ast_gen.py sz-ASTCodeGenerator.__init__..N) cfg_filename parse_cfgfilenode_cfg)selfr rrr __init__szASTCodeGenerator.__init__NcCsDttj|jd}|t7}|jD]}||d7}q ||dS)z< Generates the code into file, an open file buffer. )r z N)r_PROLOGUE_COMMENT substituter _PROLOGUE_CODErgenerate_sourcewrite)rfilesrcrrrr generates zASTCodeGenerator.generatec cst|d}|D]}|}|r|dr,q|d}|d}|d}|dksb||ksb||krrtd||f|d|}||d|}|rd d |d Dng} || fVqW5QRXdS) ze Parse the configuration file and yield pairs of (name, contents) for each node. r#:[]zInvalid line in %s: %s NcSsg|] }|qSr)strip)rvrrr r 6sz2ASTCodeGenerator.parse_cfgfile..,)openr startswithfind RuntimeErrorsplit) rfilenameflineZcolon_iZ lbracket_iZ rbracket_irvalZvallistrrr r %s     zASTCodeGenerator.parse_cfgfile)r)N)__name__ __module__ __qualname__rrr rrrr rs  rc@s@eZdZdZddZddZddZdd Zd d Zd d Z dS)rz Node configuration. name: node name contents: a list of contents - attributes and child nodes See comment at the top of the configuration file for details. cCs~||_g|_g|_g|_g|_|D]V}|d}|j||drT|j|q"|drl|j|q"|j|q"dS)N*z**)r all_entriesattrchild seq_childrstripappendendswith)rrr entryZ clean_entryrrr rBs    zNodeCfg.__init__cCs<|}|d|7}|d|7}|d|7}|S)N ) _gen_init _gen_children _gen_iter_gen_attr_namesrrrrr rTs zNodeCfg.generate_sourcecCsd|j}|jrDd|j}ddd|jD}|d7}d|}nd}d}|d |7}|d |7}|jd gD]}|d ||f7}qp|S) Nzclass %s(Node): z, css|]}d|VqdS)z'{0}'N)format)rerrr `sz$NodeCfg._gen_init..z, 'coord', '__weakref__'z(self, %s, coord=None)z'coord', '__weakref__'z(self, coord=None)z __slots__ = (%s) z def __init__%s: Zcoordz self.%s = %s )rr/join)rrargsslotsZarglistrrrr r8[s     zNodeCfg._gen_initcCsdd}|jrX|d7}|jD]}|dt|d7}q|jD]}|dt|d7}q6|d7}n|d7}|S)Nz def children(self): z nodelist = [] zV if self.%(child)s is not None: nodelist.append(("%(child)s", self.%(child)s)) r1zu for i, child in enumerate(self.%(child)s or []): nodelist.append(("%(child)s[%%d]" %% i, child)) z return tuple(nodelist) z return () r/r1dictr2rrr1r2rrr r9os    zNodeCfg._gen_childrencCshd}|jr\|jD]}|dt|d7}q|jD]}|dt|d7}q.|jsd|jsd|d7}n|d7}|S)Nz def __iter__(self): zH if self.%(child)s is not None: yield self.%(child)s rCzE for child in (self.%(child)s or []): yield child z return yield rDrFrrr r:s(   zNodeCfg._gen_itercCs"dddd|jDd}|S)Nz attr_names = (css|]}d|VqdS)z%r, Nr)rnmrrr r?sz*NodeCfg._gen_attr_names..))r@r0r<rrr r;szNodeCfg._gen_attr_namesN) r+r,r-__doc__rrr8r9r:r;rrrr r:sra#----------------------------------------------------------------- # ** ATTENTION ** # This code was automatically generated from the file: # $cfg_filename # # Do not modify it directly. Modify the configuration file and # run the generator again. # ** ** *** ** ** # # pycparser: c_ast.py # # AST Node classes. # # Eli Bendersky [https://eli.thegreenplace.net/] # License: BSD #----------------------------------------------------------------- a3 import sys def _repr(obj): """ Get the representation of an object, with dedicated pprint-like format for lists. """ if isinstance(obj, list): return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' else: return repr(obj) class Node(object): __slots__ = () """ Abstract base class for AST nodes. """ def __repr__(self): """ Generates a python representation of the current node """ result = self.__class__.__name__ + '(' indent = '' separator = '' for name in self.__slots__[:-2]: result += separator result += indent result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) separator = ',' indent = '\n ' + (' ' * len(self.__class__.__name__)) result += indent + ')' return result def children(self): """ A sequence of all children that are Nodes """ pass def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None): """ Pretty print the Node and all its attributes and children (recursively) to a buffer. buf: Open IO buffer into which the Node is printed. offset: Initial offset (amount of leading spaces) attrnames: True if you want to see the attribute names in name=value pairs. False to only see the values. nodenames: True if you want to see the actual node names within their parents. showcoord: Do you want the coordinates of each Node to be displayed. """ lead = ' ' * offset if nodenames and _my_node_name is not None: buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ') else: buf.write(lead + self.__class__.__name__+ ': ') if self.attr_names: if attrnames: nvlist = [(n, getattr(self,n)) for n in self.attr_names] attrstr = ', '.join('%s=%s' % nv for nv in nvlist) else: vlist = [getattr(self, n) for n in self.attr_names] attrstr = ', '.join('%s' % v for v in vlist) buf.write(attrstr) if showcoord: buf.write(' (at %s)' % self.coord) buf.write('\n') for (child_name, child) in self.children(): child.show( buf, offset=offset + 2, attrnames=attrnames, nodenames=nodenames, showcoord=showcoord, _my_node_name=child_name) class NodeVisitor(object): """ A base NodeVisitor class for visiting c_ast nodes. Subclass it and define your own visit_XXX methods, where XXX is the class name you want to visit with these methods. For example: class ConstantVisitor(NodeVisitor): def __init__(self): self.values = [] def visit_Constant(self, node): self.values.append(node.value) Creates a list of values of all the constant nodes encountered below the given node. To use it: cv = ConstantVisitor() cv.visit(node) Notes: * generic_visit() will be called for AST nodes for which no visit_XXX method was defined. * The children of nodes for which a visit_XXX was defined will not be visited - if you need this, call generic_visit() on the node. You can use: NodeVisitor.generic_visit(self, node) * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) """ _method_cache = None def visit(self, node): """ Visit a node. """ if self._method_cache is None: self._method_cache = {} visitor = self._method_cache.get(node.__class__.__name__, None) if visitor is None: method = 'visit_' + node.__class__.__name__ visitor = getattr(self, method, self.generic_visit) self._method_cache[node.__class__.__name__] = visitor return visitor(node) def generic_visit(self, node): """ Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. """ for c in node: self.visit(c) N)stringrobjectrrrrrrrr  s *n__pycache__/_build_tables.cpython-38.pyc000064400000001064147205113120014171 0ustar00U af?@sddlZddlZddgejdd<ddlmZedZeeddddlm Z e j d d d d e ddl Z ddl Z ddlZdS) N.z..)ASTCodeGeneratorz _c_ast.cfgzc_ast.pyw)c_parserTF)Z lex_optimizeZ yacc_debugZ yacc_optimize) importlibsyspathZ_ast_genrZast_gengenerateopenZ pycparserrZCParserinvalidate_cachesZlextabZyacctabZc_astr r H/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/_build_tables.pys  __pycache__/ast_transforms.cpython-38.pyc000064400000007244147205113120014454 0ustar00U af;@s0ddlmZddZddZddZdd Zd S) )c_astcCst|tjstt|jtjs"|Stg|jj}d}|jjp@gD]\}t|tjtj fr||j |t ||j|jd}qB|dkr|j |qB|j |qB||_|S)a The 'case' statements in a 'switch' come out of parsing with one child node, so subsequent statements are just tucked to the parent Compound. Additionally, consecutive (fall-through) case statements come out messy. This is a peculiarity of the C grammar. The following: switch (myvar) { case 10: k = 10; p = k + 1; return 10; case 20: case 30: return 20; default: break; } Creates this tree (pseudo-dump): Switch ID: myvar Compound: Case 10: k = 10 p = k + 1 return 10 Case 20: Case 30: return 20 Default: break The goal of this transform is to fix this mess, turning it into the following: Switch ID: myvar Compound: Case 10: k = 10 p = k + 1 return 10 Case 20: Case 30: return 20 Default: break A fixed AST node is returned. The argument may be modified. N) isinstancerZSwitchAssertionErrorstmtZCompoundZcoordZ block_itemsCaseDefaultappend_extract_nested_casestmts)Z switch_nodeZ new_compoundZ last_casechildr I/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/ast_transforms.pyfix_switch_cases s3   rcCs:t|jdtjtjfr6||jt|d|dS)z Recursively extract consecutive Case statements that are made nested by the parser and add them to the stmts_list. rN)rr rrrr popr )Z case_nodeZ stmts_listr r rr csr cCst|\}}|sqq|}t|tjsJz |j}Wqtk rF|YSXqd|jkrjd|jkrj|jd|jdkr||j |_|S)aK Atomic specifiers like _Atomic(type) are unusually structured, conferring a qualifier upon the contained type. This function fixes a decl with atomic specifiers to have a sane AST structure, by removing spurious Typename->TypeDecl pairs and attaching the _Atomic qualifier in the right place. _AtomicN) _fix_atomic_specifiers_oncerrTypeDecltypeAttributeErrorqualsr Zdeclnamename)declfoundtypr r rfix_atomic_specifiersls      rcCs|}d}|j}|dk r`t|tjr.d|jkr.q`z|}|}|j}Wqtk r\|dfYSXqt|tjspt|j|_d|jjkr|jjd|dfS)z Performs one 'fix' round of atomic specifiers. Returns (modified_decl, found) where found is True iff a fix was made. NrFT) rrrZTypenamerrrrr )rparentZ grandparentnoder r rrs"  rN)rrr rrr r r r s V  __pycache__/c_ast.cpython-38.pyc000064400000107510147205113120012475 0ustar00U afz@sDddlZddZGdddeZGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZ GdddeZ GdddeZ GdddeZ GdddeZ GdddeZGdddeZGdddeZGd d!d!eZGd"d#d#eZGd$d%d%eZGd&d'd'eZGd(d)d)eZGd*d+d+eZGd,d-d-eZGd.d/d/eZGd0d1d1eZGd2d3d3eZGd4d5d5eZGd6d7d7eZGd8d9d9eZGd:d;d;eZGdd?d?eZ Gd@dAdAeZ!GdBdCdCeZ"GdDdEdEeZ#GdFdGdGeZ$GdHdIdIeZ%GdJdKdKeZ&GdLdMdMeZ'GdNdOdOeZ(GdPdQdQeZ)GdRdSdSeZ*GdTdUdUeZ+GdVdWdWeZ,GdXdYdYeZ-GdZd[d[eZ.Gd\d]d]eZ/Gd^d_d_eZ0Gd`dadaeZ1GdbdcdceZ2GdddedeeZ3GdfdgdgeZ4GdhdidieZ5dS)jNcCs2t|tr&dddd|DdSt|SdS)z[ Get the representation of an object, with dedicated pprint-like format for lists. [z, css|]}t|ddVqdS)  N)_reprreplace).0er @/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/c_ast.py sz_repr..z ]N) isinstancelistjoinrepr)objr r r rs rc@s8eZdZdZddZddZejdddddfd d ZdS) Noder c Cs|jjd}d}d}|jddD]f}||7}||7}||dtt||dddt|t|jj7}d }d dt|jj}q"||d 7}|S) z? Generates a python representation of the current node (N=rz  ,r)) __class____name__ __slots__rgetattrrlen)selfresultindent separatornamer r r __repr__"s : z Node.__repr__cCsdS)z3 A sequence of all children that are Nodes Nr rr r r children5sz Node.childrenrFNc sd|}|r4|dk r4||jjd|dn||jjdjr|r~fddjD}dd d |D} n(fd djD} dd d | D} || |r|d j|dD]"\} } | j||d|||| dqdS)a Pretty print the Node and all its attributes and children (recursively) to a buffer. buf: Open IO buffer into which the Node is printed. offset: Initial offset (amount of leading spaces) attrnames: True if you want to see the attribute names in name=value pairs. False to only see the values. nodenames: True if you want to see the actual node names within their parents. showcoord: Do you want the coordinates of each Node to be displayed. rNz : z: csg|]}|t|fqSr rrnr$r r XszNode.show..z, css|]}d|VqdS)z%s=%sNr )rnvr r r r YszNode.show..csg|]}t|qSr r&r'r$r r r)[scss|]}d|VqdS)z%sNr )rvr r r r \sz (at %s)r)offset attrnames nodenames showcoord _my_node_name)writerr attr_namesrcoordr%show) rbufr-r.r/r0r1ZleadZnvlistZattrstrvlistZ child_namechildr r$r r5:s.    z Node.show) r __module__ __qualname__rr#r%sysstdoutr5r r r r rsrc@s$eZdZdZdZddZddZdS) NodeVisitora- A base NodeVisitor class for visiting c_ast nodes. Subclass it and define your own visit_XXX methods, where XXX is the class name you want to visit with these methods. For example: class ConstantVisitor(NodeVisitor): def __init__(self): self.values = [] def visit_Constant(self, node): self.values.append(node.value) Creates a list of values of all the constant nodes encountered below the given node. To use it: cv = ConstantVisitor() cv.visit(node) Notes: * generic_visit() will be called for AST nodes for which no visit_XXX method was defined. * The children of nodes for which a visit_XXX was defined will not be visited - if you need this, call generic_visit() on the node. You can use: NodeVisitor.generic_visit(self, node) * Modeled after Python's own AST visiting facilities (the ast module of Python 3.0) NcCsZ|jdkri|_|j|jjd}|dkrRd|jj}t|||j}||j|jj<||S)z Visit a node. Nvisit_) _method_cachegetrrr generic_visit)rnodevisitormethodr r r visits  zNodeVisitor.visitcCs|D]}||qdS)zy Called if no explicit visitor function exists for a node. Implements preorder visiting of the node. N)rE)rrBcr r r rAszNodeVisitor.generic_visit)rr9r:__doc__r?rErAr r r r r=ms!r=c@s.eZdZdZd ddZddZddZd ZdS) ArrayDecl)typedim dim_qualsr4 __weakref__NcCs||_||_||_||_dSN)rIrJrKr4)rrIrJrKr4r r r __init__szArrayDecl.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|S)NrIrJ)rIappendrJtuplernodelistr r r r%s   zArrayDecl.childrenccs(|jdk r|jV|jdk r$|jVdSrM)rIrJr$r r r __iter__s  zArrayDecl.__iter__)rK)Nrr9r:rrNr%rSr3r r r r rHs  rHc@s.eZdZdZd ddZddZddZd ZdS) ArrayRef)r" subscriptr4rLNcCs||_||_||_dSrM)r"rVr4)rr"rVr4r r r rNszArrayRef.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|S)Nr"rV)r"rOrVrPrQr r r r%s   zArrayRef.childrenccs(|jdk r|jV|jdk r$|jVdSrM)r"rVr$r r r rSs  zArrayRef.__iter__r )NrTr r r r rUs  rUc@s.eZdZdZd ddZddZddZd ZdS) Assignment)oplvaluervaluer4rLNcCs||_||_||_||_dSrM)rXrYrZr4)rrXrYrZr4r r r rNszAssignment.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|S)NrYrZ)rYrOrZrPrQr r r r%s   zAssignment.childrenccs(|jdk r|jV|jdk r$|jVdSrM)rYrZr$r r r rSs  zAssignment.__iter__rX)NrTr r r r rWs  rWc@s.eZdZdZd ddZddZddZd ZdS) Alignas) alignmentr4rLNcCs||_||_dSrM)r]r4)rr]r4r r r rNszAlignas.__init__cCs&g}|jdk r|d|jft|S)Nr])r]rOrPrQr r r r%s zAlignas.childrenccs|jdk r|jVdSrM)r]r$r r r rSs zAlignas.__iter__r )NrTr r r r r\s  r\c@s.eZdZdZd ddZddZddZd ZdS) BinaryOp)rXleftrightr4rLNcCs||_||_||_||_dSrM)rXr_r`r4)rrXr_r`r4r r r rNszBinaryOp.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|S)Nr_r`)r_rOr`rPrQr r r r%s   zBinaryOp.childrenccs(|jdk r|jV|jdk r$|jVdSrM)r_r`r$r r r rSs  zBinaryOp.__iter__r[)NrTr r r r r^s  r^c@s.eZdZdZd ddZddZddZd ZdS) Breakr4rLNcCs ||_dSrMr4rr4r r r rNszBreak.__init__cCsdSNr r r$r r r r%szBreak.childrenccsdSrMr r$r r r rSszBreak.__iter__r )NrTr r r r ras  rac@s.eZdZdZd ddZddZddZd ZdS) Case)exprstmtsr4rLNcCs||_||_||_dSrM)rgrhr4)rrgrhr4r r r rNsz Case.__init__cCsPg}|jdk r|d|jft|jp(gD]\}}|d||fq,t|S)Nrg stmts[%d])rgrO enumeraterhrPrrRir8r r r r%$s  z Case.childrenccs,|jdk r|jV|jpgD] }|VqdSrM)rgrhrr8r r r rS+s z Case.__iter__r )NrTr r r r rfs  rfc@s.eZdZdZd ddZddZddZd ZdS) Cast)to_typergr4rLNcCs||_||_||_dSrM)rorgr4)rrorgr4r r r rN5sz Cast.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|S)Nrorg)rorOrgrPrQr r r r%:s   z Cast.childrenccs(|jdk r|jV|jdk r$|jVdSrM)rorgr$r r r rS@s  z Cast.__iter__r )NrTr r r r rn3s  rnc@s.eZdZdZd ddZddZddZd ZdS) Compound) block_itemsr4rLNcCs||_||_dSrM)rqr4)rrqr4r r r rNJszCompound.__init__cCs6g}t|jpgD]\}}|d||fqt|S)Nzblock_items[%d])rjrqrOrPrkr r r r%NszCompound.childrenccs|jpgD] }|Vq dSrM)rqrmr r r rSTszCompound.__iter__r )NrTr r r r rpHs  rpc@s.eZdZdZd ddZddZddZd ZdS) CompoundLiteral)rIinitr4rLNcCs||_||_||_dSrM)rIrsr4)rrIrsr4r r r rN\szCompoundLiteral.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|S)NrIrs)rIrOrsrPrQr r r r%as   zCompoundLiteral.childrenccs(|jdk r|jV|jdk r$|jVdSrM)rIrsr$r r r rSgs  zCompoundLiteral.__iter__r )NrTr r r r rrZs  rrc@s.eZdZdZd ddZddZddZd ZdS) Constant)rIvaluer4rLNcCs||_||_||_dSrM)rIrur4)rrIrur4r r r rNqszConstant.__init__cCs g}t|SrMrPrQr r r r%vszConstant.childrenccsdSrMr r$r r r rSzszConstant.__iter__)rIru)NrTr r r r rtos  rtc@s.eZdZdZd ddZddZddZd ZdS) ContinuerbNcCs ||_dSrMrcrdr r r rNszContinue.__init__cCsdSrer r$r r r r%szContinue.childrenccsdSrMr r$r r r rSszContinue.__iter__r )NrTr r r r rws  rwc@s.eZdZdZd ddZddZddZd ZdS) Decl) r"qualsalignstoragefuncspecrIrsbitsizer4rLNc Cs:||_||_||_||_||_||_||_||_| |_dSrM) r"ryrzr{r|rIrsr}r4) rr"ryrzr{r|rIrsr}r4r r r rNsz Decl.__init__cCsZg}|jdk r|d|jf|jdk r8|d|jf|jdk rR|d|jft|S)NrIrsr})rIrOrsr}rPrQr r r r%s   z Decl.childrenccs:|jdk r|jV|jdk r$|jV|jdk r6|jVdSrM)rIrsr}r$r r r rSs    z Decl.__iter__)r"ryrzr{r|)NrTr r r r rxs  rxc@s.eZdZdZd ddZddZddZd ZdS) DeclList)declsr4rLNcCs||_||_dSrM)rr4)rrr4r r r rNszDeclList.__init__cCs6g}t|jpgD]\}}|d||fqt|SNz decls[%d]rjrrOrPrkr r r r%szDeclList.childrenccs|jpgD] }|Vq dSrMrrmr r r rSszDeclList.__iter__r )NrTr r r r r~s  r~c@s.eZdZdZd ddZddZddZd ZdS) Default)rhr4rLNcCs||_||_dSrM)rhr4)rrhr4r r r rNszDefault.__init__cCs6g}t|jpgD]\}}|d||fqt|S)Nri)rjrhrOrPrkr r r r%szDefault.childrenccs|jpgD] }|Vq dSrM)rhrmr r r rSszDefault.__iter__r )NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) DoWhilecondstmtr4rLNcCs||_||_||_dSrMrrr4rrrr4r r r rNszDoWhile.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|SNrrrrOrrPrQr r r r%s   zDoWhile.childrenccs(|jdk r|jV|jdk r$|jVdSrMrrr$r r r rSs  zDoWhile.__iter__r )NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) EllipsisParamrbNcCs ||_dSrMrcrdr r r rNszEllipsisParam.__init__cCsdSrer r$r r r r%szEllipsisParam.childrenccsdSrMr r$r r r rSszEllipsisParam.__iter__r )NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) EmptyStatementrbNcCs ||_dSrMrcrdr r r rNszEmptyStatement.__init__cCsdSrer r$r r r r%szEmptyStatement.childrenccsdSrMr r$r r r rSszEmptyStatement.__iter__r )NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) Enum)r"valuesr4rLNcCs||_||_||_dSrM)r"rr4)rr"rr4r r r rNsz Enum.__init__cCs&g}|jdk r|d|jft|S)Nr)rrOrPrQr r r r%s z Enum.childrenccs|jdk r|jVdSrM)rr$r r r rS s z Enum.__iter__r")NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) Enumerator)r"rur4rLNcCs||_||_||_dSrM)r"rur4)rr"rur4r r r rNszEnumerator.__init__cCs&g}|jdk r|d|jft|S)Nru)rurOrPrQr r r r%s zEnumerator.childrenccs|jdk r|jVdSrM)rur$r r r rSs zEnumerator.__iter__r)NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) EnumeratorList) enumeratorsr4rLNcCs||_||_dSrM)rr4)rrr4r r r rN'szEnumeratorList.__init__cCs6g}t|jpgD]\}}|d||fqt|S)Nzenumerators[%d])rjrrOrPrkr r r r%+szEnumeratorList.childrenccs|jpgD] }|Vq dSrM)rrmr r r rS1szEnumeratorList.__iter__r )NrTr r r r r%s  rc@s.eZdZdZd ddZddZddZd ZdS) ExprListexprsr4rLNcCs||_||_dSrMrr4rrr4r r r rN9szExprList.__init__cCs6g}t|jpgD]\}}|d||fqt|SNz exprs[%d]rjrrOrPrkr r r r%=szExprList.childrenccs|jpgD] }|Vq dSrMrrmr r r rSCszExprList.__iter__r )NrTr r r r r7s  rc@s.eZdZdZd ddZddZddZd ZdS) FileAST)extr4rLNcCs||_||_dSrM)rr4)rrr4r r r rNKszFileAST.__init__cCs6g}t|jpgD]\}}|d||fqt|S)Nzext[%d])rjrrOrPrkr r r r%OszFileAST.childrenccs|jpgD] }|Vq dSrM)rrmr r r rSUszFileAST.__iter__r )NrTr r r r rIs  rc@s.eZdZdZd ddZddZddZd ZdS) For)rsrnextrr4rLNcCs"||_||_||_||_||_dSrM)rsrrrr4)rrsrrrr4r r r rN]s z For.__init__cCstg}|jdk r|d|jf|jdk r8|d|jf|jdk rR|d|jf|jdk rl|d|jft|S)Nrsrrr)rsrOrrrrPrQr r r r%ds    z For.childrenccsL|jdk r|jV|jdk r$|jV|jdk r6|jV|jdk rH|jVdSrM)rsrrrr$r r r rSls    z For.__iter__r )NrTr r r r r[s   rc@s.eZdZdZd ddZddZddZd ZdS) FuncCall)r"argsr4rLNcCs||_||_||_dSrM)r"rr4)rr"rr4r r r rNzszFuncCall.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|S)Nr"r)r"rOrrPrQr r r r%s   zFuncCall.childrenccs(|jdk r|jV|jdk r$|jVdSrM)r"rr$r r r rSs  zFuncCall.__iter__r )NrTr r r r rxs  rc@s.eZdZdZd ddZddZddZd ZdS) FuncDecl)rrIr4rLNcCs||_||_||_dSrM)rrIr4)rrrIr4r r r rNszFuncDecl.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|S)NrrI)rrOrIrPrQr r r r%s   zFuncDecl.childrenccs(|jdk r|jV|jdk r$|jVdSrM)rrIr$r r r rSs  zFuncDecl.__iter__r )NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) FuncDef)decl param_declsbodyr4rLNcCs||_||_||_||_dSrM)rrrr4)rrrrr4r r r rNszFuncDef.__init__cCsjg}|jdk r|d|jf|jdk r8|d|jft|jpBgD]\}}|d||fqFt|S)Nrrzparam_decls[%d])rrOrrjrrPrkr r r r%s  zFuncDef.childrenccs>|jdk r|jV|jdk r$|jV|jp,gD] }|Vq.dSrM)rrrrmr r r rSs   zFuncDef.__iter__r )NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) Gotor"r4rLNcCs||_||_dSrMr"r4rr"r4r r r rNsz Goto.__init__cCs g}t|SrMrvrQr r r r%sz Goto.childrenccsdSrMr r$r r r rSsz Goto.__iter__r)NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) IDrNcCs||_||_dSrMrrr r r rNsz ID.__init__cCs g}t|SrMrvrQr r r r%sz ID.childrenccsdSrMr r$r r r rSsz ID.__iter__r)NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) IdentifierType)namesr4rLNcCs||_||_dSrM)rr4)rrr4r r r rNszIdentifierType.__init__cCs g}t|SrMrvrQr r r r%szIdentifierType.childrenccsdSrMr r$r r r rSszIdentifierType.__iter__)r)NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) Ifriftrueiffalser4rLNcCs||_||_||_||_dSrMrrrr4rrrrr4r r r rNsz If.__init__cCsZg}|jdk r|d|jf|jdk r8|d|jf|jdk rR|d|jft|SNrrrrrOrrrPrQr r r r%s   z If.childrenccs:|jdk r|jV|jdk r$|jV|jdk r6|jVdSrMrrrr$r r r rSs    z If.__iter__r )NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) InitListrNcCs||_||_dSrMrrr r r rNszInitList.__init__cCs6g}t|jpgD]\}}|d||fqt|Srrrkr r r r% szInitList.childrenccs|jpgD] }|Vq dSrMrrmr r r rSszInitList.__iter__r )NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) Label)r"rr4rLNcCs||_||_||_dSrM)r"rr4)rr"rr4r r r rNszLabel.__init__cCs&g}|jdk r|d|jft|S)Nr)rrOrPrQr r r r%s zLabel.childrenccs|jdk r|jVdSrM)rr$r r r rS#s zLabel.__iter__r)NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) NamedInitializer)r"rgr4rLNcCs||_||_||_dSrM)r"rgr4)rr"rgr4r r r rN+szNamedInitializer.__init__cCsPg}|jdk r|d|jft|jp(gD]\}}|d||fq,t|S)Nrgzname[%d])rgrOrjr"rPrkr r r r%0s  zNamedInitializer.childrenccs,|jdk r|jV|jpgD] }|VqdSrM)rgr"rmr r r rS7s zNamedInitializer.__iter__r )NrTr r r r r)s  rc@s.eZdZdZd ddZddZddZd ZdS) ParamList)paramsr4rLNcCs||_||_dSrM)rr4)rrr4r r r rNAszParamList.__init__cCs6g}t|jpgD]\}}|d||fqt|S)Nz params[%d])rjrrOrPrkr r r r%EszParamList.childrenccs|jpgD] }|Vq dSrM)rrmr r r rSKszParamList.__iter__r )NrTr r r r r?s  rc@s.eZdZdZd ddZddZddZd ZdS) PtrDecl)ryrIr4rLNcCs||_||_||_dSrM)ryrIr4)rryrIr4r r r rNSszPtrDecl.__init__cCs&g}|jdk r|d|jft|SNrIrIrOrPrQr r r r%Xs zPtrDecl.childrenccs|jdk r|jVdSrMrIr$r r r rS]s zPtrDecl.__iter__)ry)NrTr r r r rQs  rc@s.eZdZdZd ddZddZddZd ZdS) Return)rgr4rLNcCs||_||_dSrM)rgr4)rrgr4r r r rNeszReturn.__init__cCs&g}|jdk r|d|jft|SNrgrgrOrPrQr r r r%is zReturn.childrenccs|jdk r|jVdSrMrgr$r r r rSns zReturn.__iter__r )NrTr r r r rcs  rc@s.eZdZdZd ddZddZddZd ZdS) StaticAssert)rmessager4rLNcCs||_||_||_dSrM)rrr4)rrrr4r r r rNvszStaticAssert.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|S)Nrr)rrOrrPrQr r r r%{s   zStaticAssert.childrenccs(|jdk r|jV|jdk r$|jVdSrM)rrr$r r r rSs  zStaticAssert.__iter__r )NrTr r r r rts  rc@s.eZdZdZd ddZddZddZd ZdS) Structr"rr4rLNcCs||_||_||_dSrMr"rr4rr"rr4r r r rNszStruct.__init__cCs6g}t|jpgD]\}}|d||fqt|Srrrkr r r r%szStruct.childrenccs|jpgD] }|Vq dSrMrrmr r r rSszStruct.__iter__r)NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) StructRef)r"rIfieldr4rLNcCs||_||_||_||_dSrM)r"rIrr4)rr"rIrr4r r r rNszStructRef.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|S)Nr"r)r"rOrrPrQr r r r%s   zStructRef.childrenccs(|jdk r|jV|jdk r$|jVdSrM)r"rr$r r r rSs  zStructRef.__iter__r)NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) SwitchrNcCs||_||_||_dSrMrrr r r rNszSwitch.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|SrrrQr r r r%s   zSwitch.childrenccs(|jdk r|jV|jdk r$|jVdSrMrr$r r r rSs  zSwitch.__iter__r )NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) TernaryOprNcCs||_||_||_||_dSrMrrr r r rNszTernaryOp.__init__cCsZg}|jdk r|d|jf|jdk r8|d|jf|jdk rR|d|jft|SrrrQr r r r%s   zTernaryOp.childrenccs:|jdk r|jV|jdk r$|jV|jdk r6|jVdSrMrr$r r r rSs    zTernaryOp.__iter__r )NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) TypeDecl)declnameryrzrIr4rLNcCs"||_||_||_||_||_dSrM)rryrzrIr4)rrryrzrIr4r r r rNs zTypeDecl.__init__cCs&g}|jdk r|d|jft|SrrrQr r r r%s zTypeDecl.childrenccs|jdk r|jVdSrMrr$r r r rSs zTypeDecl.__iter__)rryrz)NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) Typedef)r"ryr{rIr4rLNcCs"||_||_||_||_||_dSrM)r"ryr{rIr4)rr"ryr{rIr4r r r rNs zTypedef.__init__cCs&g}|jdk r|d|jft|SrrrQr r r r%s zTypedef.childrenccs|jdk r|jVdSrMrr$r r r rSs zTypedef.__iter__)r"ryr{)NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) Typename)r"ryrzrIr4rLNcCs"||_||_||_||_||_dSrM)r"ryrzrIr4)rr"ryrzrIr4r r r rN s zTypename.__init__cCs&g}|jdk r|d|jft|SrrrQr r r r%s zTypename.childrenccs|jdk r|jVdSrMrr$r r r rSs zTypename.__iter__)r"ryrz)NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) UnaryOp)rXrgr4rLNcCs||_||_||_dSrM)rXrgr4)rrXrgr4r r r rNszUnaryOp.__init__cCs&g}|jdk r|d|jft|SrrrQr r r r%#s zUnaryOp.childrenccs|jdk r|jVdSrMrr$r r r rS(s zUnaryOp.__iter__r[)NrTr r r r rs  rc@s.eZdZdZd ddZddZddZd ZdS) UnionrNcCs||_||_||_dSrMrrr r r rN0szUnion.__init__cCs6g}t|jpgD]\}}|d||fqt|Srrrkr r r r%5szUnion.childrenccs|jpgD] }|Vq dSrMrrmr r r rS;szUnion.__iter__r)NrTr r r r r.s  rc@s.eZdZdZd ddZddZddZd ZdS) WhilerNcCs||_||_||_dSrMrrr r r rNCszWhile.__init__cCs@g}|jdk r|d|jf|jdk r8|d|jft|SrrrQr r r r%Hs   zWhile.childrenccs(|jdk r|jV|jdk r$|jVdSrMrr$r r r rSNs  zWhile.__iter__r )NrTr r r r rAs  rc@s.eZdZdZd ddZddZddZd ZdS) Pragma)stringr4rLNcCs||_||_dSrM)rr4)rrr4r r r rNXszPragma.__init__cCs g}t|SrMrvrQr r r r%\szPragma.childrenccsdSrMr r$r r r rS`szPragma.__iter__)r)NrTr r r r rVs  r)6r;robjectrr=rHrUrWr\r^rarfrnrprrrtrwrxr~rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r sh O:__pycache__/c_generator.cpython-38.pyc000064400000042674147205113120013705 0ustar00U aflE@s ddlmZGdddeZdS))c_astc@s6eZdZdZdddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdddddddddddd d d!d!d"d"d"d#Zd$d%Zd&d'Zd(d)Zd*d+Zdd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Zd@dAZdBdCZdDdEZ dFdGZ!dHdIZ"dJdKZ#dLdMZ$dNdOZ%dPdQZ&dRdSZ'dTdUZ(dVdWZ)dXdYZ*dZd[Z+d\d]Z,d^d_Z-d`daZ.dbdcZ/dddeZ0dfdgZ1dhdiZ2djdkZ3dldmZ4dndoZ5dpdqZ6drdsZ7dtduZ8dvdwZ9dxdyZ:dzd{Z;d|d}ZgdfddZ?ddZ@ddZAddZBdS) CGeneratorz Uses the same visitor pattern as c_ast.NodeVisitor, but modified to return a value from each visit method, using string accumulation in generic_visit. FcCsd|_||_dS)z Constructs C-code generator reduce_parentheses: if True, eliminates needless parentheses on binary operators N) indent_levelreduce_parentheses)selfrrF/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/c_generator.py__init__szCGenerator.__init__cCs d|jSN )rrrrr _make_indentszCGenerator._make_indentcCsd|jj}t|||j|S)Nvisit_) __class____name__getattr generic_visit)rnodemethodrrr visits zCGenerator.visitcs,|dkr dSdfdd|DSdS)Nc3s|]\}}|VqdSNr).0Zc_namecr rr 'sz+CGenerator.generic_visit..)joinchildren)rrrr r r#szCGenerator.generic_visitcCs|jSr)valuernrrr visit_Constant)szCGenerator.visit_ConstantcCs|jSrnamer rrr visit_ID,szCGenerator.visit_IDcCsd}|jr|d|j7}|S)Nz#pragmar )string)rr!retrrr visit_Pragma/szCGenerator.visit_PragmacCs$||j}|d||jdS)N[])_parenthesize_unless_simpler$rZ subscript)rr!Zarrrefrrr visit_ArrayRef5s zCGenerator.visit_ArrayRefcCs"||j}||j||jSr)r+r$typerfield)rr!Zsrefrrr visit_StructRef9s zCGenerator.visit_StructRefcCs$||j}|d||jdS)N())r+r$rargs)rr!Zfrefrrr visit_FuncCall=s zCGenerator.visit_FuncCallcCs\|jdkrd||jS||j}|jdkr8d|S|jdkrJd|Sd|j|fSdS)Nsizeofz sizeof(%s)zp++z%s++zp--z%s--z%s%s)oprexprr+)rr!operandrrr visit_UnaryOpAs    zCGenerator.visit_UnaryOprr )z||z&&|^&z==z!=>z>=>z<<+-*/%cs@jfdd}jfdd}d|j|fS)Ncs6|p2jo2t|tjo2j|jjjk Sr_is_simple_noder isinstancerBinaryOpprecedence_mapr5dr!rrr ks z+CGenerator.visit_BinaryOp..cs6|p2jo2t|tjo2j|jjjk SrrKrPrRrr rSws %s %s %s)_parenthesize_ifleftrightr5)rr!Zlval_strrval_strrrRr visit_BinaryOp_s    zCGenerator.visit_BinaryOpcCs*||jdd}d||j|j|fS)NcSs t|tjSr)rMr Assignment)r!rrr rSz-CGenerator.visit_Assignment..rT)rUZrvaluerZlvaluer5)rr!rXrrr visit_Assignment|s zCGenerator.visit_AssignmentcCs d|jSr )rnamesr rrr visit_IdentifierTypeszCGenerator.visit_IdentifierTypecCsJt|tjrd||dSt|tjr.)rdeclslenrrr!rgrr r visit_DeclLists  zCGenerator.visit_DeclListcCs2d}|jr|d|jd7}|||j7}|S)Nrr )storager_generate_typer-rnrrr visit_Typedefs zCGenerator.visit_TypedefcCs,d|j|jddd}|d||jS)Nr0F emit_declnamer1r )rqZto_typer+r6rnrrr visit_CastszCGenerator.visit_CastcCs*g}|jD]}|||q d|SNriexprsappendrbrrr!Zvisited_subexprsr6rrr visit_ExprLists zCGenerator.visit_ExprListcCs*g}|jD]}|||q d|Srvrwrzrrr visit_InitLists zCGenerator.visit_InitListcCs|j|ddS)Nenumr#_generate_struct_union_enumr rrr visit_EnumszCGenerator.visit_EnumcCsd||jS)Nz _Alignas({}))formatr alignmentr rrr visit_AlignasszCGenerator.visit_AlignascCs<|jsdj||jdSdj||j||jdSdS)Nz{indent}{name}, )indentr$z{indent}{name} = {value}, )rr$r)rrrr$rr rrr visit_Enumerators zCGenerator.visit_Enumeratorcsj|j}d_|j}|jrVdfdd|jD}|d|d|dS|d|dSdS)Nr; c3s|]}|VqdSrr)rpr rr rsz+CGenerator.visit_FuncDef.. )rrkrbodyZ param_declsr)rr!rkrZknrdeclsrr r visit_FuncDefs  zCGenerator.visit_FuncDefcCsbd}|jD]R}t|tjr*|||7}q t|tjrJ|||d7}q |||d7}q |S)Nrrr)extrMrZFuncDefrZPragma)rr!rgrrrr visit_FileASTs   zCGenerator.visit_FileASTcs`d}jd7_|jr>|dfdd|jD7}jd8_|d7}|S)N{ r9rc3s|]}|VqdSr_generate_stmt)rstmtr rr rsz,CGenerator.visit_Compound..z} )rrZ block_itemsrrnrr r visit_Compounds zCGenerator.visit_CompoundcCs$d||jd||jdS)Nr0z){r`)rr-rer rrr visit_CompoundLiteralsz CGenerator.visit_CompoundLiteralcCsdS)N;rr rrr visit_EmptyStatementszCGenerator.visit_EmptyStatementcsdfdd|jDS)Nric3s|]}|VqdSrr)rparamr rr rsz-CGenerator.visit_ParamList..)rparamsr rr r visit_ParamListszCGenerator.visit_ParamListcCs&d}|jr|d||j7}|dS)Nreturnr r)r6rrnrrr visit_ReturnszCGenerator.visit_ReturncCsdS)Nzbreak;rr rrr visit_BreakszCGenerator.visit_BreakcCsdS)Nz continue;rr rrr visit_ContinueszCGenerator.visit_ContinuecCsHd||jd}|d||jd7}|d||jd7}|S)Nr0z) ? z) : r1)rbcondiftrueiffalsernrrr visit_TernaryOpszCGenerator.visit_TernaryOpcCsdd}|jr|||j7}|d7}||j|jdd7}|jr`||d7}||j|jdd7}|S)Nzif () T add_indentzelse )rrrrrrrnrrr visit_IfszCGenerator.visit_IfcCs~d}|jr|||j7}|d7}|jr<|d||j7}|d7}|jr^|d||j7}|d7}||j|jdd7}|S)Nzfor (rr rTr)rerrnextrrrnrrr visit_For szCGenerator.visit_ForcCs:d}|jr|||j7}|d7}||j|jdd7}|S)Nwhile (rTr)rrrrrnrrr visit_Whiles zCGenerator.visit_WhilecCsJd}||j|jdd7}||d7}|jr>|||j7}|d7}|S)Nzdo Trrz);)rrrrrrnrrr visit_DoWhileszCGenerator.visit_DoWhilecCs>d}|||j7}|jr2|d7}|||j7}|d7}|S)Nz_Static_assert(,r1)rrmessagernrrr visit_StaticAssert$szCGenerator.visit_StaticAssertcCs,d||jd}||j|jdd7}|S)Nzswitch (rTr)rrrrrnrrr visit_Switch-szCGenerator.visit_SwitchcCs6d||jd}|jD]}||j|dd7}q|S)Nzcase : Tr)rr6stmtsrrr!rgrrrr visit_Case2s zCGenerator.visit_CasecCs&d}|jD]}||j|dd7}q |S)Nz default: Tr)rrrrrr visit_Default8s zCGenerator.visit_DefaultcCs|jd||jS)Nr)r$rrr rrr visit_Label>szCGenerator.visit_LabelcCsd|jdS)Nzgoto rr#r rrr visit_GotoAszCGenerator.visit_GotocCsdS)Nz...rr rrr visit_EllipsisParamDszCGenerator.visit_EllipsisParamcCs ||dS)Nstructr~r rrr visit_StructGszCGenerator.visit_StructcCs ||jSr)rqr-r rrr visit_TypenameJszCGenerator.visit_TypenamecCs ||dS)Nunionr~r rrr visit_UnionMszCGenerator.visit_UnioncCsZd}|jD]6}t|tjr*|d|j7}q |d||d7}q |d||j7}|S)Nr.r)r*rc)r$rMrIDrrbr6)rr!rgr$rrr visit_NamedInitializerPs  z!CGenerator.visit_NamedInitializercCs ||Srrqr rrr visit_FuncDeclZszCGenerator.visit_FuncDeclcCs|j|ddSNFrsrr rrr visit_ArrayDecl]szCGenerator.visit_ArrayDeclcCs|j|ddSrrr rrr visit_TypeDecl`szCGenerator.visit_TypeDeclcCs|j|ddSrrr rrr visit_PtrDeclcszCGenerator.visit_PtrDeclcCs|dkr|j}|j}n(|dks"t|jdkr0dn|jj}|j}|d|jpLd}|dk r|d7}||7}|jd7_|d7}|||7}|jd8_||d 7}|S) zq Generates code for structs, unions, and enums. name should be 'struct', 'union', or 'enum'. )rrr}Nr rrr9rr`) rl_generate_struct_union_bodyAssertionErrorvaluesZ enumerators_generate_enum_bodyr$rr)rr!r$membersZ body_functionrgrrr rfs    z&CGenerator._generate_struct_union_enumcsdfdd|DS)Nrc3s|]}|VqdSrrrjr rr rsz9CGenerator._generate_struct_union_body..rrrrr r r~sz&CGenerator._generate_struct_union_bodycs$dfdd|DdddS)Nrc3s|]}|VqdSrr)rrr rr rsz1CGenerator._generate_enum_body..rrrrr r rszCGenerator._generate_enum_bodycCst|}|r|jd7_|}|r4|jd8_|tjtjtjtjtjtj tj tj tj tj tjtjtjf kr|||dS|tjfkr||S|tjfkr|||S|||dSdS)z Generation from a statement node. This method exists as a wrapper for individual visit_* methods to handle different treatment of some statements in this context. r9rrN)r-rrrDeclrZZCastUnaryOprNZ TernaryOpFuncCallArrayRef StructRefConstantrZTypedefrarZCompoundIf)rr!rtyprrrr rs6   zCGenerator._generate_stmtcCsfd}|jrd|jd}|jr4|d|jd7}|jrR|||jdd7}|||j7}|S)z& Generation from a Decl node. rr r)ZfuncspecrrpZalignrrqr-rnrrr rdszCGenerator._generate_declTc Cs t|}|tjkrd}|jr2|d|jd7}|||j7}|jrR|rR|jnd}t|D]\}}t|tj r|dkrt||dtj rd|d}|d7}|j r|d|j d7}|||j d7}q^t|tj r(|dkrt||dtj rd|d}|d||jd7}q^t|tj r^|jr`d d|j|rVd|ndf}q^d |}q^|r||d|7}|S|tjkr||jS|tjkr|j|j|d S|tjkrd|jdS|tj tj tj fkr|j|j||g|d S||Sd S) z Recursive generation from a type node. n is the type node. modifiers collects the PtrDecl, ArrayDecl and FuncDecl modifiers encountered on the way down to a TypeDecl, to allow proper generation from it. rr rrr0r1r)r*z* %s%srHrsN)r-rZTypeDeclZqualsrrZdeclname enumeraterMZ ArrayDeclZPtrDeclZ dim_qualsZdimZFuncDeclr2rrdZTypenamerqZIdentifierTyper]) rr! modifiersrtrrgZnstrimodifierrrr rqsV             zCGenerator._generate_typecCs&||}||rd|dS|SdS)z Visits 'n' and returns its string representation, parenthesized if the condition function applied to the node returns True. r0r1N)rb)rr! conditionrgrrr rUs  zCGenerator._parenthesize_ifcs|fddS)z. Common use case for _parenthesize_if cs | Sr)rLrPr rr rSr[z8CGenerator._parenthesize_unless_simple..)rUr rr r r+sz&CGenerator._parenthesize_unless_simplecCst|tjtjtjtjtjfS)z~ Returns True for nodes that are "simple" - i.e. nodes that always have higher precedence than operators. )rMrrrrrrr rrr rLszCGenerator._is_simple_nodeN)F)F)F)Cr __module__ __qualname____doc__r rrrr"r%r(r,r/r3r8rOrYr\r^rbrhrorrrur{r|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrdrqrUr+rLrrrr r s            5 rN)rrobjectrrrrr  s __pycache__/c_lexer.cpython-38.pyc000064400000031452147205113120013026 0ustar00U af"C@s4ddlZddlmZddlmZGdddeZdS)N)lex)TOKENc@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ dZ dZ iZe D]Zeee<q\e D](Zeeeddedd<qre e dZdZdZdZdZdZdZdededZd eZeeeZeeeZd!Zd"Zd#Zd$Z d%Z!d&ed'ed'e d(Z"d)Z#d*e"dZ$d+e$d+Z%d,e%Z&d-e%Z'd.e%Z(d/e%Z)d+e$d0Z*d1e$d2e$d3Z+d1e$d4e!d5Z,d6e#dZ-d7e-d8Z.d,e.Z/d-e.Z0d.e.Z1d/e.Z2d7e-d9e!e-d8Z3d:Z4d;Z5dZ6d?Z7d@edAedBedCZ8dDedDed'e8de7dEZ9dFZ:dGdHZ;edMdNZ?dOdPZ@dQZAdRdSZBdTdUZCdVdWZDdQZEdXdYZFdZd[ZGdQZHd\d]ZId^ZJd_ZKd`ZLdaZMdbZNdcZOddZPdeZQdfZRdgZSdhZTdiZUdjZVdkZWdlZXdmZYdnZZdoZ[dpZ\dqZ]drZ^dsZ_dtZ`duZadvZbdwZcdxZddyZedzZfd{Zgd|Zhd}Zid~ZjdZkdZldZmdZndZodZpdZqdZrdZsdZtdZue>z\|\|z&&!<>z<=z>=z==z!==z\*=z/=z%=z\+=z-=z<<=z>>=z&=z\|=z\^=z\+\+z--z->z\?z\(z\)z\[z\],z\.;:z\.\.\.z\{cCs ||Sr)rrYrrrt_LBRACEszCLexer.t_LBRACEz\}cCs ||Sr)r rYrrrt_RBRACEszCLexer.t_RBRACEcCs|SrrrYrrr t_FLOAT_CONSTszCLexer.t_FLOAT_CONSTcCs|SrrrYrrrt_HEX_FLOAT_CONSTszCLexer.t_HEX_FLOAT_CONSTcCs|SrrrYrrrt_INT_CONST_HEXszCLexer.t_INT_CONST_HEXcCs|SrrrYrrrt_INT_CONST_BINszCLexer.t_INT_CONST_BINcCsd}|||dS)NzInvalid octal constantrgrrZr'rrrt_BAD_CONST_OCTszCLexer.t_BAD_CONST_OCTcCs|SrrrYrrrt_INT_CONST_OCTszCLexer.t_INT_CONST_OCTcCs|SrrrYrrrt_INT_CONST_DECszCLexer.t_INT_CONST_DECcCs|SrrrYrrrt_INT_CONST_CHARszCLexer.t_INT_CONST_CHARcCs|SrrrYrrr t_CHAR_CONSTszCLexer.t_CHAR_CONSTcCs|SrrrYrrr t_WCHAR_CONSTszCLexer.t_WCHAR_CONSTcCs|SrrrYrrrt_U8CHAR_CONSTszCLexer.t_U8CHAR_CONSTcCs|SrrrYrrrt_U16CHAR_CONSTszCLexer.t_U16CHAR_CONSTcCs|SrrrYrrrt_U32CHAR_CONSTszCLexer.t_U32CHAR_CONSTcCsd}|||dS)Nz Unmatched 'rgrrrrt_UNMATCHED_QUOTEszCLexer.t_UNMATCHED_QUOTEcCsd|j}|||dS)NzInvalid char constant %s)r\r)rrrrt_BAD_CHAR_CONSTs zCLexer.t_BAD_CHAR_CONSTcCs|SrrrYrrrt_WSTRING_LITERAL szCLexer.t_WSTRING_LITERALcCs|SrrrYrrrt_U8STRING_LITERALszCLexer.t_U8STRING_LITERALcCs|SrrrYrrrt_U16STRING_LITERALszCLexer.t_U16STRING_LITERALcCs|SrrrYrrrt_U32STRING_LITERALszCLexer.t_U32STRING_LITERALcCsd}|||dS)Nz#String contains invalid escape codergrrrrt_BAD_STRING_LITERALszCLexer.t_BAD_STRING_LITERALcCs2|j|jd|_|jdkr.||jr.d|_|S)Nr1r2) keyword_mapgetr\rXr rYrrrt_ID"sz CLexer.t_IDcCs"dt|jd}|||dS)NzIllegal character %sr)reprr\r)rrrrt_error)szCLexer.t_error)__name__ __module__ __qualname____doc__rrrrrr$r)r%keywordsZ keywords_newrkeywordloweruppertokens identifierZ hex_prefixZ hex_digits bin_prefixZ bin_digitsZinteger_suffix_optZdecimal_constantZoctal_constantZ hex_constantZ bin_constantZbad_octal_constantZ simple_escapeZdecimal_escapeZ hex_escapeZ bad_escapeZescape_sequenceZescape_sequence_start_in_stringZ cconst_charZ char_constZ wchar_constZ u8char_constZ u16char_constZ u32char_constZmulticharacter_constantZunmatched_quoteZbad_char_constZ string_charZstring_literalZwstring_literalZu8string_literalZu16string_literalZu32string_literalZbad_string_literalZ exponent_partZfractional_constantZfloating_constantZbinary_exponent_partZhex_fractional_constantZhex_floating_constantZstatesr[rr_r`rdrfZt_ppline_ignorerhrirjZt_pppragma_ignorerkrlZt_ignorernZt_PLUSZt_MINUSZt_TIMESZt_DIVIDEZt_MODZt_ORZt_ANDZt_NOTZt_XORZt_LSHIFTZt_RSHIFTZt_LORZt_LANDZt_LNOTZt_LTZt_GTZt_LEZt_GEZt_EQZt_NEZt_EQUALSZ t_TIMESEQUALZ t_DIVEQUALZ t_MODEQUALZ t_PLUSEQUALZ t_MINUSEQUALZ t_LSHIFTEQUALZ t_RSHIFTEQUALZ t_ANDEQUALZ t_OREQUALZ t_XOREQUALZ t_PLUSPLUSZ t_MINUSMINUSZt_ARROWZt_CONDOPZt_LPARENZt_RPARENZ t_LBRACKETZ t_RBRACKETZt_COMMAZt_PERIODZt_SEMIZt_COLONZ t_ELLIPSISr{r|Zt_STRING_LITERALr}r~rrrrrrrrrrrrrrrrrrrrrrrrrsJ!   & C       $                           r)r ZplyrZply.lexrrrrrrr s  __pycache__/c_parser.cpython-38.pyc000064400000177225147205113120013214 0ustar00U af*"@sdddlmZddlmZddlmZddlmZmZm Z m Z ddl m Z m Z e GdddeZdS) )yacc)c_ast)CLexer) PLYParser ParseError parameterizedtemplate)fix_switch_casesfix_atomic_specifiersc@seZdZdedddddfddZd_dd Zd d Zd d ZddZddZ ddZ ddZ ddZ ddZ ddZddZddZd d!Zd`d"d#Zdad$d%Zd&d'Zd(d)Zd*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Zd=d>Z d?d@Z!dAdBZ"dCdDZ#dEdFZ$dGdHZ%dIdJZ&dKdLZ'dMdNZ(dOdPZ)dQdRZ*dSdTZ+dUdVZ,dWdXZ-dYdZZ.d[d\Z/d]d^Z0d_d`Z1dadbZ2dcddZ3dedfZ4dgdhZ5didjZ6dkdlZ7dmdnZ8dodpZ9dqdrZ:dsdtZ;dudvZd{d|Z?d}d~Z@ddZAddZBddZCddZDddZEddZFddZGddZHddZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTddZUddZVddZWeXdddddZYeXdddddZZeXdddddZ[eXddddZ\eXdddddZ]eXdddddZ^eXdddddZ_eXdddddZ`ddZaddÄZbddńZcddDŽZdddɄZedd˄Zfdd̈́ZgddτZhddфZiddӄZjddՄZkddׄZlddلZmddۄZndd݄Zodd߄ZpddZqddZrddZsddZtddZuddZvddZwddZxddZyddZzddZ{ddZ|ddZ}ddZ~ddZddZddZddZddZddZdd Zd d Zd d ZddZddZddZddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zd<d=Zd>d?Zd@dAZdBdCZdDdEZdFdGZdHdIZdJdKZdLdMZdNdOZdPdQZdRdSZdTdUZdVdWZdXdYZdZd[Zd\d]Zd^S(bCParserTzpycparser.lextabzpycparser.yacctabFc Cs||j|j|j|jd|_|jj|||d|jj|_ddddddd d d d d dddg}|D]} || qZtj|d||||d|_ t g|_ d|_ dS)a Create a new CParser. Some arguments for controlling the debug/optimization level of the parser are provided. The defaults are tuned for release/performance mode. The simple rules for using them are: *) When tweaking CParser/CLexer, set these to False *) When releasing a stable parser, set to True lex_optimize: Set to False when you're modifying the lexer. Otherwise, changes in the lexer won't be used, if some lextab.py file exists. When releasing with a stable lexer, set to True to save the re-generation of the lexer table on each run. lexer: Set this parameter to define the lexer to use if you're not using the default CLexer. lextab: Points to the lex table that's used for optimized mode. Only if you're modifying the lexer and want some tests to avoid re-generating the table, make this point to a local lex table file (that's been earlier generated with lex_optimize=True) yacc_optimize: Set to False when you're modifying the parser. Otherwise, changes in the parser won't be used, if some parsetab.py file exists. When releasing with a stable parser, set to True to save the re-generation of the parser table on each run. yacctab: Points to the yacc table that's used for optimized mode. Only if you're modifying the parser, make this point to a local yacc table file yacc_debug: Generate a parser.out file that explains how yacc built the parsing table from the grammar. taboutputdir: Set this parameter to control the location of generated lextab and yacctab files. )Z error_funcZon_lbrace_funcZon_rbrace_funcZtype_lookup_func)optimizelextab outputdirZabstract_declaratorZassignment_expressionZdeclaration_listZdeclaration_specifiers_no_typeZ designationZ expressionZidentifier_listZinit_declarator_listZid_init_declarator_listZinitializer_listZparameter_type_listZblock_item_listZtype_qualifier_listZstruct_declarator_listZtranslation_unit_or_empty)modulestartdebugr Z tabmodulerN) _lex_error_func_lex_on_lbrace_func_lex_on_rbrace_func_lex_type_lookup_funcclexbuildtokensZ_create_opt_rulercparserdict _scope_stack_last_yielded_token) selfZ lex_optimizelexerrZ yacc_optimizeZyacctabZ yacc_debugZ taboutputdirZrules_with_optZruler C/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/c_parser.py__init__sN:   zCParser.__init__cCs6||j_|jtg|_d|_|jj||j|dS)a  Parses C code and returns an AST. text: A string containing the C source code filename: Name of the file being parsed (for meaningful error messages) debug: Debug flag to YACC N)inputrr)rfilenameZ reset_linenorrrrparse)rtextr$rr r r!r%s   z CParser.parsecCs|jtdSN)rappendrrr r r! _push_scopeszCParser._push_scopecCs t|jdkst|jdS)Nr)lenrAssertionErrorpopr)r r r! _pop_scopeszCParser._pop_scopecCs4|jd|ds"|d||d|jd|<dS)zC Add a new typedef name (ie a TYPEID) to the current scope Tz;Typedef %r previously declared as non-typedef in this scopeNrget _parse_errorrnamecoordr r r!_add_typedef_nameszCParser._add_typedef_namecCs4|jd|dr"|d||d|jd|<dS)ze Add a new object, function, or enum member name (ie an ID) to the current scope r/Fz;Non-typedef %r previously declared as typedef in this scopeNr0r3r r r!_add_identifierszCParser._add_identifiercCs.t|jD]}||}|dk r |Sq dS)z8 Is *name* a typedef-name in the current scope? NF)reversedrr1)rr4ZscopeZin_scoper r r!_is_type_in_scopes   zCParser._is_type_in_scopecCs|||||dSr')r2_coord)rmsglinecolumnr r r!rszCParser._lex_error_funccCs |dSr')r*r)r r r!rszCParser._lex_on_lbrace_funccCs |dSr')r.r)r r r!rszCParser._lex_on_rbrace_funccCs||}|S)z Looks up types that were previously defined with typedef. Passed to the lexer for recognizing identifiers that are types. )r9)rr4Zis_typer r r!rs zCParser._lex_type_lookup_funccCs|jjS)z We need access to yacc's lookahead token in certain cases. This is the last token yacc requested from the lexer, so we ask the lexer. )rZ last_tokenr)r r r!_get_yacc_lookahead_tokensz!CParser._get_yacc_lookahead_tokencCs\|}|}|jr|j}qt|tjr,||_|S|}t|jtjsF|j}q0|j|_||_|SdS)z Tacks a type modifier on a declarator, and returns the modified declarator. Note: the declarator and modifier may be modified N)type isinstancerTypeDecl)rdeclmodifierZ modifier_headZ modifier_tailZ decl_tailr r r!_type_modify_decls  zCParser._type_modify_declcCs|}t|tjs|j}q|j|_|jdd|_|D]:}t|tjs4t|dkr`| d|j q4||_|Sq4|st|jtj s| d|j tjdg|j d|_n tjdd|D|d j d|_|S) z- Fixes a declaration. Modifies decl. Nrz Invalid multiple types specifiedzMissing type in declarationintr5cSsg|]}|jD]}|qqSr )names).0idr4r r r! Ssz/CParser._fix_decl_name_type..) r@rrAr?declnamer4qualsIdentifierTyper+r2r5FuncDecl)rrBtypenamer?tnr r r!_fix_decl_name_type+s:      zCParser._fix_decl_name_typecCs>|ptgggggd}|r*|||n||d||S)a Declaration specifiers are represented by a dictionary with the entries: * qual: a list of type qualifiers * storage: a list of storage type qualifiers * type: a list of type specifiers * function: a list of function specifiers * alignment: a list of alignment specifiers This method is given a declaration specifier, and a new specifier of a given kind. If `append` is True, the new specifier is added to the end of the specifiers list, otherwise it's added at the beginning. Returns the declaration specifier, with the new specifier incorporated. )qualstorager?function alignmentrK)rr(insert)rZdeclspecZnewspeckindr(specr r r!_add_declaration_specifierWs z"CParser._add_declaration_specifierc Csbd|dk}g}|dddk r&n6|dddkrt|ddkstt|dd jd kst||dd jdsd }|dD]}t|d r|j}qq|d |tj|dd jddd|d|dd jd|dd<|dd =nrt |ddtj tj tj tj fs\|dd}t |tjs2|j}q|jdkr\|dd jd|_|dd =|D]} | ddk svt|rtjd|d|d| d| djd} nBtjd|d|d|d|d| d| d| d| djd } t | jtj tj tj tj fr | } n|| |d} |rH|r8|| j| jn|| j| jt| } || q`|S)z Builds a list of declarations all sharing the given specifiers. If typedef_namespace is true, each declared name is added to the "typedef namespace", which also includes objects, functions, and enum constants. typedefrTrKbitsizeNrBr?r/r?r5zInvalid declarationrVrLr?rMalignr5rS)r4rMrTr?r5rUinit r4rMr`rTZfuncspecr?rar\r5)r1r+rGr9hasattrr5r2rrAr@EnumStructUnionrNr?rLr,ZTypedefDeclrRr6r4r7r r() rrYdeclstypedef_namespaceZ is_typedefZ declarationsr5tZ decls_0_tailrB declarationZ fixed_declr r r!_build_declarationsps &           zCParser._build_declarationscCsLd|dkr|d|j|j|t|ddgddd}tj||||jd S) z' Builds a function definition. r[rTzInvalid typedefNrBraTrYrhrirK)rB param_declsbodyr5)r2r5rlrrZFuncDef)rrYrBrorprkr r r!_build_function_definitions  z"CParser._build_function_definitioncCs|dkrtjStjSdS)z` Given a token (either STRUCT or UNION), selects the appropriate AST class. structN)rrerf)rtokenr r r!_select_struct_union_classsz"CParser._select_struct_union_class) )leftZLOR)ruZLAND)ruOR)ruZXOR)ruAND)ruZEQZNE)ruGTZGELTZLE)ruZRSHIFTZLSHIFT)ruPLUSMINUS)ruZTIMESZDIVIDEZMODcCs2|ddkrtg|d<nt|d|d<dS)zh translation_unit_or_empty : translation_unit | empty rNrK)rZFileASTrpr r r!p_translation_unit_or_emptys z#CParser.p_translation_unit_or_emptycCs|d|d<dS)z4 translation_unit : external_declaration rrKNr r|r r r!p_translation_unit_1szCParser.p_translation_unit_1cCs"|d|d|d|d<dS)zE translation_unit : translation_unit external_declaration rr]rKN)extendr|r r r!p_translation_unit_2 szCParser.p_translation_unit_2cCs|dg|d<dS)z7 external_declaration : function_definition rrKNr r|r r r!p_external_declaration_1sz CParser.p_external_declaration_1cCs|d|d<dS)z/ external_declaration : declaration rrKNr r|r r r!p_external_declaration_2sz CParser.p_external_declaration_2cCs|dg|d<dS)zi external_declaration : pp_directive | pppragma_directive rrKNr r|r r r!p_external_declaration_3sz CParser.p_external_declaration_3cCs g|d<dS)z( external_declaration : SEMI rKNr r|r r r!p_external_declaration_4%sz CParser.p_external_declaration_4cCs|d|d<dS)z1 external_declaration : static_assert rrKNr r|r r r!p_external_declaration_5*sz CParser.p_external_declaration_5cCsVt|dkr.t|dd||dg|d<n$t|d|d||dg|d<dS)z static_assert : _STATIC_ASSERT LPAREN constant_expression COMMA unified_string_literal RPAREN | _STATIC_ASSERT LPAREN constant_expression RPAREN NrrK)r+rZ StaticAssert _token_coordr|r r r!p_static_assert_declaration/s "z#CParser.p_static_assert_declarationcCs|d||ddS)z pp_directive : PPHASH zDirectives not supported yetrN)r2rr|r r r!p_pp_directive8s zCParser.p_pp_directivecCspt|dkr*t|d||d|d<nBt|dkrTt|d||d|d<ntd||d|d<dS)z pppragma_directive : PPPRAGMA | PPPRAGMA PPPRAGMASTR | _PRAGMA LPAREN unified_string_literal RPAREN rrr]rKr rN)r+rZPragmarr|r r r!p_pppragma_directiveCs   zCParser.p_pppragma_directivecCs0t|dkr|dgn|d|dg|d<dS)z pppragma_directive_list : pppragma_directive | pppragma_directive_list pppragma_directive r]rrKNr+r|r r r!p_pppragma_directive_listOsz!CParser.p_pppragma_directive_listc CsNtgggtjdg||ddggd}|j||d|d|dd|d<d S) zU function_definition : id_declarator declaration_list_opt compound_statement rErrFrSrVrTr?rUr]rrYrBrorprKN)rrrNrrqrr}rYr r r!p_function_definition_1Ws zCParser.p_function_definition_1cCs.|d}|j||d|d|dd|d<dS)zl function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement rr]rrrKN)rqrr r r!p_function_definition_2iszCParser.p_function_definition_2cCs|d|d<dS)a_ statement : labeled_statement | expression_statement | compound_statement | selection_statement | iteration_statement | jump_statement | pppragma_directive | static_assert rrKNr r|r r r! p_statementxs zCParser.p_statementcCsFt|dkr6tj|d|dg||dd|d<n |d|d<dS)z} pragmacomp_or_statement : pppragma_directive_list statement | statement rrr]Z block_itemsr5rKN)r+rCompoundrr|r r r!p_pragmacomp_or_statements   z!CParser.p_pragmacomp_or_statementc Cs|d}|ddkr|d}tjtjtjf}t|dkrt|d|rtjd|d|d|d|d |ddd|djd g}q|j|t ddd gd d }n|j||dd d }||d<dS)z decl_body : declaration_specifiers init_declarator_list_opt | declaration_specifiers_no_type id_init_declarator_list_opt rr]Nr?rKrSrVrTrUrbrmTrn) rrerfrdr+r@rgr5rlr)rr}rYtyZs_u_or_erhr r r! p_decl_bodys6   zCParser.p_decl_bodycCs|d|d<dS)z& declaration : decl_body SEMI rrKNr r|r r r! p_declarationszCParser.p_declarationcCs,t|dkr|dn|d|d|d<dS)zj declaration_list : declaration | declaration_list declaration r]rrKNrr|r r r!p_declaration_list szCParser.p_declaration_listcCs||d|dd|d<dS)z] declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt r]rrSrKNrZr|r r r!"p_declaration_specifiers_no_type_1sz*CParser.p_declaration_specifiers_no_type_1cCs||d|dd|d<dS)zf declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt r]rrTrKNrr|r r r!"p_declaration_specifiers_no_type_2sz*CParser.p_declaration_specifiers_no_type_2cCs||d|dd|d<dS)za declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt r]rrUrKNrr|r r r!"p_declaration_specifiers_no_type_3sz*CParser.p_declaration_specifiers_no_type_3cCs||d|dd|d<dS)z_ declaration_specifiers_no_type : atomic_specifier declaration_specifiers_no_type_opt r]rr?rKNrr|r r r!"p_declaration_specifiers_no_type_4%sz*CParser.p_declaration_specifiers_no_type_4cCs||d|dd|d<dS)zb declaration_specifiers_no_type : alignment_specifier declaration_specifiers_no_type_opt r]rrVrKNrr|r r r!"p_declaration_specifiers_no_type_5*sz*CParser.p_declaration_specifiers_no_type_5cCs"|j|d|dddd|d<dS)zI declaration_specifiers : declaration_specifiers type_qualifier rr]rSTr(rKNrr|r r r!p_declaration_specifiers_1/sz"CParser.p_declaration_specifiers_1cCs"|j|d|dddd|d<dS)zR declaration_specifiers : declaration_specifiers storage_class_specifier rr]rTTrrKNrr|r r r!p_declaration_specifiers_24sz"CParser.p_declaration_specifiers_2cCs"|j|d|dddd|d<dS)zM declaration_specifiers : declaration_specifiers function_specifier rr]rUTrrKNrr|r r r!p_declaration_specifiers_39sz"CParser.p_declaration_specifiers_3cCs"|j|d|dddd|d<dS)zS declaration_specifiers : declaration_specifiers type_specifier_no_typeid rr]r?TrrKNrr|r r r!p_declaration_specifiers_4>sz"CParser.p_declaration_specifiers_4cCs|d|dd|d<dS)z2 declaration_specifiers : type_specifier Nrr?rKrr|r r r!p_declaration_specifiers_5Csz"CParser.p_declaration_specifiers_5cCs"|j|d|dddd|d<dS)zQ declaration_specifiers : declaration_specifiers_no_type type_specifier rr]r?TrrKNrr|r r r!p_declaration_specifiers_6Hsz"CParser.p_declaration_specifiers_6cCs"|j|d|dddd|d<dS)zN declaration_specifiers : declaration_specifiers alignment_specifier rr]rVTrrKNrr|r r r!p_declaration_specifiers_7Msz"CParser.p_declaration_specifiers_7cCs|d|d<dS)a storage_class_specifier : AUTO | REGISTER | STATIC | EXTERN | TYPEDEF | _THREAD_LOCAL rrKNr r|r r r!p_storage_class_specifierRsz!CParser.p_storage_class_specifiercCs|d|d<dS)zR function_specifier : INLINE | _NORETURN rrKNr r|r r r!p_function_specifier\szCParser.p_function_specifiercCs$tj|dg||dd|d<dS)a+ type_specifier_no_typeid : VOID | _BOOL | CHAR | SHORT | INT | LONG | FLOAT | DOUBLE | _COMPLEX | SIGNED | UNSIGNED | __INT128 rrFrKNrrNrr|r r r!p_type_specifier_no_typeidbsz"CParser.p_type_specifier_no_typeidcCs|d|d<dS)z type_specifier : typedef_name | enum_specifier | struct_or_union_specifier | type_specifier_no_typeid | atomic_specifier rrKNr r|r r r!p_type_specifierrszCParser.p_type_specifiercCs |d}|jd||d<dS)z= atomic_specifier : _ATOMIC LPAREN type_name RPAREN rZ_AtomicrKN)rMr()rr}typr r r!p_atomic_specifier|s zCParser.p_atomic_specifiercCs|d|d<dS)z type_qualifier : CONST | RESTRICT | VOLATILE | _ATOMIC rrKNr r|r r r!p_type_qualifierszCParser.p_type_qualifiercCs0t|dkr|d|dgn|dg|d<dS)z init_declarator_list : init_declarator | init_declarator_list COMMA init_declarator rrrrKNrr|r r r!p_init_declarator_listszCParser.p_init_declarator_listcCs,t|dt|dkr|dndd|d<dS)zb init_declarator : declarator | declarator EQUALS initializer rr]rNrmrKrr+r|r r r!p_init_declaratorszCParser.p_init_declaratorcCs0t|dkr|d|dgn|dg|d<dS)z id_init_declarator_list : id_init_declarator | id_init_declarator_list COMMA init_declarator rrrrKNrr|r r r!p_id_init_declarator_listsz!CParser.p_id_init_declarator_listcCs,t|dt|dkr|dndd|d<dS)zn id_init_declarator : id_declarator | id_declarator EQUALS initializer rr]rNrmrKrr|r r r!p_id_init_declaratorszCParser.p_id_init_declaratorcCs"|j|d|dddd|d<dS)zY specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid rr]r?TrrKNrr|r r r!p_specifier_qualifier_list_1sz$CParser.p_specifier_qualifier_list_1cCs"|j|d|dddd|d<dS)zO specifier_qualifier_list : specifier_qualifier_list type_qualifier rr]rSTrrKNrr|r r r!p_specifier_qualifier_list_2sz$CParser.p_specifier_qualifier_list_2cCs|d|dd|d<dS)z4 specifier_qualifier_list : type_specifier Nrr?rKrr|r r r!p_specifier_qualifier_list_3sz$CParser.p_specifier_qualifier_list_3cCs$t|dgg|dggd|d<dS)zH specifier_qualifier_list : type_qualifier_list type_specifier rr]rrKNrr|r r r!p_specifier_qualifier_list_4sz$CParser.p_specifier_qualifier_list_4cCs tg|dggggd|d<dS)z9 specifier_qualifier_list : alignment_specifier rrrKNrr|r r r!p_specifier_qualifier_list_5sz$CParser.p_specifier_qualifier_list_5cCs||d|dd|d<dS)zR specifier_qualifier_list : specifier_qualifier_list alignment_specifier rr]rVrKNrr|r r r!p_specifier_qualifier_list_6sz$CParser.p_specifier_qualifier_list_6cCs0||d}||dd||dd|d<dS)z{ struct_or_union_specifier : struct_or_union ID | struct_or_union TYPEID rr]Nr4rhr5rK)rtrrr}klassr r r!p_struct_or_union_specifier_1s  z%CParser.p_struct_or_union_specifier_1cCsX||d}t|dkr6|dg||dd|d<n|d|d||dd|d<dS)z struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close | struct_or_union brace_open brace_close rrNr]rrKrrtr+rrr r r!p_struct_or_union_specifier_2s   z%CParser.p_struct_or_union_specifier_2cCs`||d}t|dkr:||dg||dd|d<n"||d|d||dd|d<dS)a struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close | struct_or_union ID brace_open brace_close | struct_or_union TYPEID brace_open struct_declaration_list brace_close | struct_or_union TYPEID brace_open brace_close rrr]rrKrNrrr r r!p_struct_or_union_specifier_3s   z%CParser.p_struct_or_union_specifier_3cCs|d|d<dS)zF struct_or_union : STRUCT | UNION rrKNr r|r r r!p_struct_or_unionszCParser.p_struct_or_unioncCs:t|dkr|dpg|d<n|d|dp.g|d<dS)z struct_declaration_list : struct_declaration | struct_declaration_list struct_declaration r]rrKNrr|r r r!p_struct_declaration_lists z!CParser.p_struct_declaration_listcCs|d}d|dkst|ddk r8|j||dd}nht|ddkr|dd}t|tjrf|}n t|}|j|t|d gd}n|j|tddd gd}||d<dS) zW struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI rr[rTr]NrYrhr?rKrBrm)r,rlr+r@rNoderNr)rr}rYrhnodeZ decl_typer r r!p_struct_declaration_1 s*       zCParser.p_struct_declaration_1cCs d|d<dS)z# struct_declaration : SEMI NrKr r|r r r!p_struct_declaration_20szCParser.p_struct_declaration_2cCs|dg|d<dS)z1 struct_declaration : pppragma_directive rrKNr r|r r r!p_struct_declaration_35szCParser.p_struct_declaration_3cCs0t|dkr|d|dgn|dg|d<dS)z struct_declarator_list : struct_declarator | struct_declarator_list COMMA struct_declarator rrrrKNrr|r r r!p_struct_declarator_list:sz CParser.p_struct_declarator_listcCs|ddd|d<dS)z( struct_declarator : declarator rNrBr\rKr r|r r r!p_struct_declarator_1CszCParser.p_struct_declarator_1cCsFt|dkr$|d|dd|d<ntdddd|dd|d<dS)z struct_declarator : declarator COLON constant_expression | COLON constant_expression rrrrKNr])r+rrAr|r r r!p_struct_declarator_2Hs zCParser.p_struct_declarator_2cCs"t|dd||d|d<dS)zM enum_specifier : ENUM ID | ENUM TYPEID r]NrrKrrdrr|r r r!p_enum_specifier_1QszCParser.p_enum_specifier_1cCs"td|d||d|d<dS)zG enum_specifier : ENUM brace_open enumerator_list brace_close NrrrKrr|r r r!p_enum_specifier_2WszCParser.p_enum_specifier_2cCs&t|d|d||d|d<dS)z enum_specifier : ENUM ID brace_open enumerator_list brace_close | ENUM TYPEID brace_open enumerator_list brace_close r]rrrKNrr|r r r!p_enum_specifier_3\szCParser.p_enum_specifier_3cCsht|dkr*t|dg|dj|d<n:t|dkrD|d|d<n |dj|d|d|d<dS)z enumerator_list : enumerator | enumerator_list COMMA | enumerator_list COMMA enumerator r]rrKrN)r+rZEnumeratorListr5Z enumeratorsr(r|r r r!p_enumerator_listbs   zCParser.p_enumerator_listcCs t|d||d|d<dS)z alignment_specifier : _ALIGNAS LPAREN type_name RPAREN | _ALIGNAS LPAREN constant_expression RPAREN rrrKN)rZAlignasrr|r r r!p_alignment_specifieroszCParser.p_alignment_specifiercCsbt|dkr(t|dd||d}nt|d|d||d}||j|j||d<dS)zR enumerator : ID | ID EQUALS constant_expression r]rNrrK)r+rZ Enumeratorrr7r4r5)rr}Z enumeratorr r r! p_enumeratorus   zCParser.p_enumeratorcCs|d|d<dS)zQ declarator : id_declarator | typeid_declarator rrKNr r|r r r! p_declaratorszCParser.p_declarator)rIID)ZtypeidTYPEID)Ztypeid_noparenrcCs|d|d<dS)z1 xxx_declarator : direct_xxx_declarator rrKNr r|r r r!p_xxx_declarator_1szCParser.p_xxx_declarator_1cCs||d|d|d<dS)z9 xxx_declarator : pointer direct_xxx_declarator r]rrKNrDr|r r r!p_xxx_declarator_2szCParser.p_xxx_declarator_2c Cs(tj|dddd||dd|d<dS)z' direct_xxx_declarator : yyy rNr_rK)rrArr|r r r!p_direct_xxx_declarator_1s z!CParser.p_direct_xxx_declarator_1cCs|d|d<dS)z@ direct_xxx_declarator : LPAREN xxx_declarator RPAREN r]rKNr r|r r r!p_direct_xxx_declarator_2sz!CParser.p_direct_xxx_declarator_2cCsft|dkr|dngpg}tjdt|dkr6|dn|d||djd}|j|d|d|d<dS) z} direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET rrNrrr?Zdim dim_qualsr5rBrCrK)r+r ArrayDeclr5rD)rr}rMarrr r r!p_direct_xxx_declarator_3sz!CParser.p_direct_xxx_declarator_3cCs^dd|d|dfD}dd|D}tjd|d||djd }|j|d|d |d <dS) z direct_xxx_declarator : direct_xxx_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET | direct_xxx_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET cSs g|]}t|tr|n|gqSr r@list)rHitemr r r!rJsz5CParser.p_direct_xxx_declarator_4..rrcSs"g|]}|D]}|dk r |q qSr'r )rHZsublistrSr r r!rJs NrrrrrKrrr5rD)rr}Z listed_qualsrrr r r!p_direct_xxx_declarator_4sz!CParser.p_direct_xxx_declarator_4c CsZtjdt|d||d|ddk r0|dng|djd}|j|d|d|d<dS)zi direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET NrrrrrrKrrrrr5rDrr}rr r r!p_direct_xxx_declarator_5sz!CParser.p_direct_xxx_declarator_5cCsztj|dd|djd}|jdkr`|jdk r`|jjD]$}t|tjrNq`| |j |jq:|j |d|d|d<dS)z direct_xxx_declarator : direct_xxx_declarator LPAREN parameter_type_list RPAREN | direct_xxx_declarator LPAREN identifier_list_opt RPAREN rNrargsr?r5LBRACErrK) rrOr5r>r?rparamsr@ EllipsisParamr7r4rD)rr}funcparamr r r!p_direct_xxx_declarator_6s   z!CParser.p_direct_xxx_declarator_6cCsj||d}tj|dpgd|d}t|dkr^|d}|jdk rJ|j}q8||_|d|d<n||d<dS)zm pointer : TIMES type_qualifier_list_opt | TIMES type_qualifier_list_opt pointer rr]N)rMr?r5rrK)rrZPtrDeclr+r?)rr}r5Z nested_typeZ tail_typer r r! p_pointers   zCParser.p_pointercCs0t|dkr|dgn|d|dg|d<dS)zs type_qualifier_list : type_qualifier | type_qualifier_list type_qualifier r]rrKNrr|r r r!p_type_qualifier_listszCParser.p_type_qualifier_listcCs:t|dkr*|djt||d|d|d<dS)zn parameter_type_list : parameter_list | parameter_list COMMA ELLIPSIS r]rrrKN)r+rr(rrrr|r r r!p_parameter_type_lists zCParser.p_parameter_type_listcCsNt|dkr*t|dg|dj|d<n |dj|d|d|d<dS)zz parameter_list : parameter_declaration | parameter_list COMMA parameter_declaration r]rrKrNr+rZ ParamListr5rr(r|r r r!p_parameter_list#s zCParser.p_parameter_listcCsT|d}|ds.tjdg||ddg|d<|j|t|ddgdd|d<d S) z parameter_declaration : declaration_specifiers id_declarator | declaration_specifiers typeid_noparen_declarator rr?rErFr]rrrKN)rrNrrlrrr r r!p_parameter_declaration_17s z!CParser.p_parameter_declaration_1c Cs|d}|ds.tjdg||ddg|d<t|ddkrt|ddjdkr||ddjdr|j|t|ddd gd d}nHtjd |d d|dpt dddd||dd }|d}| ||}||d<dS)zR parameter_declaration : declaration_specifiers abstract_declarator_opt rr?rErFr/rKr]Nrmrr rSr4rMr`r?r5) rrNrr+rGr9rlrTypenamerArR)rr}rYrBrPr r r!p_parameter_declaration_2Cs0 &  z!CParser.p_parameter_declaration_2cCsNt|dkr*t|dg|dj|d<n |dj|d|d|d<dS)ze identifier_list : identifier | identifier_list COMMA identifier r]rrKrNrr|r r r!p_identifier_listcs zCParser.p_identifier_listcCs|d|d<dS)z- initializer : assignment_expression rrKNr r|r r r!p_initializer_1mszCParser.p_initializer_1cCs6|ddkr&tg||d|d<n |d|d<dS)z initializer : brace_open initializer_list_opt brace_close | brace_open initializer_list COMMA brace_close r]NrrK)rInitListrr|r r r!p_initializer_2rs zCParser.p_initializer_2cCst|dkrN|ddkr |dnt|d|d}t|g|dj|d<nD|ddkrb|dnt|d|d}|dj||d|d<dS)z initializer_list : designation_opt initializer | initializer_list COMMA designation_opt initializer rrNr]rKr)r+rZNamedInitializerrr5exprsr()rr}rar r r!p_initializer_list{s  ((zCParser.p_initializer_listcCs|d|d<dS)z. designation : designator_list EQUALS rrKNr r|r r r! p_designationszCParser.p_designationcCs0t|dkr|dgn|d|dg|d<dS)z_ designator_list : designator | designator_list designator r]rrKNrr|r r r!p_designator_listszCParser.p_designator_listcCs|d|d<dS)zi designator : LBRACKET constant_expression RBRACKET | PERIOD identifier r]rKNr r|r r r! p_designatorszCParser.p_designatorc Cs\tjd|ddddd|dp0tdddd||dd}|||dd|d<dS) zH type_name : specifier_qualifier_list abstract_declarator_opt r rrSNr]rr?rK)rrrArrR)rr}rPr r r! p_type_names zCParser.p_type_namecCs*tdddd}|j||dd|d<dS)z+ abstract_declarator : pointer NrrrK)rrArD)rr}Z dummytyper r r!p_abstract_declarator_1s zCParser.p_abstract_declarator_1cCs||d|d|d<dS)zF abstract_declarator : pointer direct_abstract_declarator r]rrKNrr|r r r!p_abstract_declarator_2szCParser.p_abstract_declarator_2cCs|d|d<dS)z> abstract_declarator : direct_abstract_declarator rrKNr r|r r r!p_abstract_declarator_3szCParser.p_abstract_declarator_3cCs|d|d<dS)zA direct_abstract_declarator : LPAREN abstract_declarator RPAREN r]rKNr r|r r r!p_direct_abstract_declarator_1sz&CParser.p_direct_abstract_declarator_1cCs6tjd|dg|djd}|j|d|d|d<dS)zn direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET NrrrrrKrrr r r!p_direct_abstract_declarator_2sz&CParser.p_direct_abstract_declarator_2cCsbt|dkr|dngpg}tjtddddt|dkrB|dn|d|||dd|d<dS)zk direct_abstract_declarator : LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET rr]NrrrrK)r+rrrAr)rr}rMr r r!p_direct_abstract_declarator_3s z&CParser.p_direct_abstract_declarator_3c CsFtjdt|d||dg|djd}|j|d|d|d<dS)zZ direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET NrrrrrKrrr r r!p_direct_abstract_declarator_4sz&CParser.p_direct_abstract_declarator_4c CsBtjtddddt|d||dg||dd|d<dS)z? direct_abstract_declarator : LBRACKET TIMES RBRACKET NrrrrK)rrrArrr|r r r!p_direct_abstract_declarator_5s  z&CParser.p_direct_abstract_declarator_5cCs4tj|dd|djd}|j|d|d|d<dS)zh direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN rNrrrrK)rrOr5rD)rr}rr r r!p_direct_abstract_declarator_6s z&CParser.p_direct_abstract_declarator_6cCs0tj|dtdddd||dd|d<dS)zM direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN r]NrrrK)rrOrArr|r r r!p_direct_abstract_declarator_7s  z&CParser.p_direct_abstract_declarator_7cCs(t|dtr|dn|dg|d<dS)zG block_item : declaration | statement rrKNrr|r r r! p_block_itemszCParser.p_block_itemcCs:t|dks|ddgkr"|dn|d|d|d<dS)z_ block_item_list : block_item | block_item_list block_item r]NrrKrr|r r r!p_block_item_listszCParser.p_block_item_listcCs"tj|d||dd|d<dS)zA compound_statement : brace_open block_item_list_opt brace_close r]rrrKN)rrrr|r r r!p_compound_statement_1s zCParser.p_compound_statement_1cCs&t|d|d||d|d<dS)z6 labeled_statement : ID COLON pragmacomp_or_statement rrrKN)rZLabelrr|r r r!p_labeled_statement_1szCParser.p_labeled_statement_1cCs(t|d|dg||d|d<dS)zL labeled_statement : CASE constant_expression COLON pragmacomp_or_statement r]rrrKN)rZCaserr|r r r!p_labeled_statement_2szCParser.p_labeled_statement_2cCs"t|dg||d|d<dS)z; labeled_statement : DEFAULT COLON pragmacomp_or_statement rrrKN)rZDefaultrr|r r r!p_labeled_statement_3szCParser.p_labeled_statement_3c Cs(t|d|dd||d|d<dS)zK selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement rrNrrKrIfrr|r r r!p_selection_statement_1!szCParser.p_selection_statement_1c Cs,t|d|d|d||d|d<dS)zZ selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement rrrrKNrr|r r r!p_selection_statement_2%szCParser.p_selection_statement_2c Cs*tt|d|d||d|d<dS)zO selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement rrrrKN)r rZSwitchrr|r r r!p_selection_statement_3)szCParser.p_selection_statement_3cCs&t|d|d||d|d<dS)zN iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement rrrrKN)rWhilerr|r r r!p_iteration_statement_1.szCParser.p_iteration_statement_1cCs&t|d|d||d|d<dS)zV iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI rr]rrKN)rZDoWhilerr|r r r!p_iteration_statement_22szCParser.p_iteration_statement_2c Cs2t|d|d|d|d||d|d<dS)zx iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement rrr rrKN)rForrr|r r r!p_iteration_statement_36szCParser.p_iteration_statement_3c CsBtt|d||d|d|d|d||d|d<dS)zp iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement rrrrKN)rr%ZDeclListrr|r r r!p_iteration_statement_4:s  zCParser.p_iteration_statement_4cCs t|d||d|d<dS)z jump_statement : GOTO ID SEMI r]rrKN)rZGotorr|r r r!p_jump_statement_1?szCParser.p_jump_statement_1cCst||d|d<dS)z jump_statement : BREAK SEMI rrKN)rBreakrr|r r r!p_jump_statement_2CszCParser.p_jump_statement_2cCst||d|d<dS)z! jump_statement : CONTINUE SEMI rrKN)rContinuerr|r r r!p_jump_statement_3GszCParser.p_jump_statement_3cCs0tt|dkr|dnd||d|d<dS)z\ jump_statement : RETURN expression SEMI | RETURN SEMI rr]NrrK)rReturnr+rr|r r r!p_jump_statement_4KszCParser.p_jump_statement_4cCs4|ddkr$t||d|d<n |d|d<dS)z, expression_statement : expression_opt SEMI rNr]rK)rZEmptyStatementrr|r r r!p_expression_statementQs zCParser.p_expression_statementcCsjt|dkr|d|d<nLt|dtjsFt|dg|dj|d<|dj|d|d|d<dS)zn expression : assignment_expression | expression COMMA assignment_expression r]rrKrN)r+r@rExprListr5rr(r|r r r! p_expressionXs  zCParser.p_expressioncCs|d|d<dS)z: assignment_expression : LPAREN compound_statement RPAREN r]rKNr r|r r r!#p_parenthesized_compound_expressionesz+CParser.p_parenthesized_compound_expressioncCs$tj|dg||dd|d<dS)z typedef_name : TYPEID rrFrKNrr|r r r!p_typedef_nameiszCParser.p_typedef_namecCsDt|dkr|d|d<n&t|d|d|d|dj|d<dS)z assignment_expression : conditional_expression | unary_expression assignment_operator assignment_expression r]rrKrN)r+rZ Assignmentr5r|r r r!p_assignment_expressionms zCParser.p_assignment_expressioncCs|d|d<dS)a assignment_operator : EQUALS | XOREQUAL | TIMESEQUAL | DIVEQUAL | MODEQUAL | PLUSEQUAL | MINUSEQUAL | LSHIFTEQUAL | RSHIFTEQUAL | ANDEQUAL | OREQUAL rrKNr r|r r r!p_assignment_operator{s zCParser.p_assignment_operatorcCs|d|d<dS)z. constant_expression : conditional_expression rrKNr r|r r r!p_constant_expressionszCParser.p_constant_expressioncCsDt|dkr|d|d<n&t|d|d|d|dj|d<dS)z conditional_expression : binary_expression | binary_expression CONDOP expression COLON conditional_expression r]rrKrrN)r+rZ TernaryOpr5r|r r r!p_conditional_expressions z CParser.p_conditional_expressioncCsDt|dkr|d|d<n&t|d|d|d|dj|d<dS)ak binary_expression : cast_expression | binary_expression TIMES binary_expression | binary_expression DIVIDE binary_expression | binary_expression MOD binary_expression | binary_expression PLUS binary_expression | binary_expression MINUS binary_expression | binary_expression RSHIFT binary_expression | binary_expression LSHIFT binary_expression | binary_expression LT binary_expression | binary_expression LE binary_expression | binary_expression GE binary_expression | binary_expression GT binary_expression | binary_expression EQ binary_expression | binary_expression NE binary_expression | binary_expression AND binary_expression | binary_expression OR binary_expression | binary_expression XOR binary_expression | binary_expression LAND binary_expression | binary_expression LOR binary_expression r]rrKrN)r+rZBinaryOpr5r|r r r!p_binary_expressions zCParser.p_binary_expressioncCs|d|d<dS)z$ cast_expression : unary_expression rrKNr r|r r r!p_cast_expression_1szCParser.p_cast_expression_1cCs&t|d|d||d|d<dS)z; cast_expression : LPAREN type_name RPAREN cast_expression r]rrrKN)rZCastrr|r r r!p_cast_expression_2szCParser.p_cast_expression_2cCs|d|d<dS)z* unary_expression : postfix_expression rrKNr r|r r r!p_unary_expression_1szCParser.p_unary_expression_1cCs$t|d|d|dj|d<dS)z unary_expression : PLUSPLUS unary_expression | MINUSMINUS unary_expression | unary_operator cast_expression rr]rKNrUnaryOpr5r|r r r!p_unary_expression_2szCParser.p_unary_expression_2cCs:t|dt|dkr|dn|d||d|d<dS)z unary_expression : SIZEOF unary_expression | SIZEOF LPAREN type_name RPAREN | _ALIGNOF LPAREN type_name RPAREN rrr]rKN)rr?r+rr|r r r!p_unary_expression_3s  zCParser.p_unary_expression_3cCs|d|d<dS)z unary_operator : AND | TIMES | PLUS | MINUS | NOT | LNOT rrKNr r|r r r!p_unary_operatorszCParser.p_unary_operatorcCs|d|d<dS)z* postfix_expression : primary_expression rrKNr r|r r r!p_postfix_expression_1szCParser.p_postfix_expression_1cCs$t|d|d|dj|d<dS)zG postfix_expression : postfix_expression LBRACKET expression RBRACKET rrrKN)rArrayRefr5r|r r r!p_postfix_expression_2szCParser.p_postfix_expression_2cCs4t|dt|dkr|dnd|dj|d<dS)z postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN | postfix_expression LPAREN RPAREN rrrNrK)rFuncCallr+r5r|r r r!p_postfix_expression_3szCParser.p_postfix_expression_3cCs>t|d||d}t|d|d||dj|d<dS)z postfix_expression : postfix_expression PERIOD ID | postfix_expression PERIOD TYPEID | postfix_expression ARROW ID | postfix_expression ARROW TYPEID rrr]rKN)rrr StructRefr5)rr}fieldr r r!p_postfix_expression_4szCParser.p_postfix_expression_4cCs(td|d|d|dj|d<dS)z{ postfix_expression : postfix_expression PLUSPLUS | postfix_expression MINUSMINUS r}r]rrKNr>r|r r r!p_postfix_expression_5szCParser.p_postfix_expression_5cCst|d|d|d<dS)z postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close r]rrKN)rZCompoundLiteralr|r r r!p_postfix_expression_6szCParser.p_postfix_expression_6cCs|d|d<dS)z" primary_expression : identifier rrKNr r|r r r!p_primary_expression_1szCParser.p_primary_expression_1cCs|d|d<dS)z primary_expression : constant rrKNr r|r r r!p_primary_expression_2szCParser.p_primary_expression_2cCs|d|d<dS)zp primary_expression : unified_string_literal | unified_wstring_literal rrKNr r|r r r!p_primary_expression_3szCParser.p_primary_expression_3cCs|d|d<dS)z0 primary_expression : LPAREN expression RPAREN r]rKNr r|r r r!p_primary_expression_4 szCParser.p_primary_expression_4cCsB||d}tt|d|t|d|dg|||d<dS)za primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN rrrrKN)rrrFrr2)rr}r5r r r!p_primary_expression_5 s  zCParser.p_primary_expression_5cCst|dkr|d|d<nrt|dkrNt|d|d|d|dj|d<n>t|dkr|t|d|d|dj|d<ntdt|dS) z offsetof_member_designator : identifier | offsetof_member_designator PERIOD identifier | offsetof_member_designator LBRACKET expression RBRACKET r]rrKrrrz$Unexpected parsing state. len(p): %uN)r+rrHr5rDNotImplementedErrorr|r r r!p_offsetof_member_designators  ( "z$CParser.p_offsetof_member_designatorcCsNt|dkr*t|dg|dj|d<n |dj|d|d|d<dS)z argument_expression_list : assignment_expression | argument_expression_list COMMA assignment_expression r]rrKrN)r+rr2r5rr(r|r r r!p_argument_expression_list#s z"CParser.p_argument_expression_listcCs t|d||d|d<dS)z identifier : ID rrKN)rrrr|r r r! p_identifier-szCParser.p_identifiercCsd}d}|dddD]&}|dkr.|d7}q|dkr|d7}qd}|dkrVtdn|d krftd d |d |}t|d |d||d|d<dS)z constant : INT_CONST_DEC | INT_CONST_OCT | INT_CONST_HEX | INT_CONST_BIN | INT_CONST_CHAR rKrNlL)uUr z.Constant cannot have more than one u/U suffix.r]z.Constant cannot have more than two l/L suffix.z unsigned zlong rE) ValueErrorrConstantr)rr}ZuCountZlCountxrjprefixr r r! p_constant_11s$    zCParser.p_constant_1cCshd|dkrd}n0|dddkr,d}n|dddkrBd}nd}t||d||d|d <d S) zM constant : FLOAT_CONST | HEX_FLOAT_CONST r^rfloatr/)fFrWz long doubledoublerKN)lowerrr]r)rr}rjr r r! p_constant_2Hs zCParser.p_constant_2cCs"td|d||d|d<dS)z constant : CHAR_CONST | WCHAR_CONST | U8CHAR_CONST | U16CHAR_CONST | U32CHAR_CONST charrrKN)rr]rr|r r r! p_constant_3Ys  zCParser.p_constant_3cCsdt|dkr,td|d||d|d<n4|djdd|ddd|d_|d|d<dS)z~ unified_string_literal : STRING_LITERAL | unified_string_literal STRING_LITERAL r]stringrrKNr/)r+rr]rvaluer|r r r!p_unified_string_literalhs  (z CParser.p_unified_string_literalcCsht|dkr,td|d||d|d<n8|djdd|ddd|d_|d|d<dS)a unified_wstring_literal : WSTRING_LITERAL | U8STRING_LITERAL | U16STRING_LITERAL | U32STRING_LITERAL | unified_wstring_literal WSTRING_LITERAL | unified_wstring_literal U8STRING_LITERAL | unified_wstring_literal U16STRING_LITERAL | unified_wstring_literal U32STRING_LITERAL r]rirrKNr/)r+rr]rrjrstripr|r r r!p_unified_wstring_literalss  ,z!CParser.p_unified_wstring_literalcCs"|d|d<|d|ddS)z brace_open : LBRACE rrKNZ set_linenolinenor|r r r! p_brace_opens zCParser.p_brace_opencCs"|d|d<|d|ddS)z brace_close : RBRACE rrKNrnr|r r r! p_brace_closes zCParser.p_brace_closecCs d|d<dS)zempty : NrKr r|r r r!p_emptyszCParser.p_emptycCs@|r,|d|j|j|j|j|dn|d|jjdS)Nz before: %s)ror=zAt end of input)r2rjr:rorZfind_tok_columnr$r|r r r!p_errors zCParser.p_errorN)r F)F)F)__name__ __module__ __qualname__rr"r%r*r.r6r7r9rrrrr>rDrRrZrlrqrt precedencer~rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrr r"r#r&r)r*r,r.r0r1r3r4r5r6r7r8r9r:r;r<r=r@rArBrCrErGrJrKrLrMrNrOrPrQrSrTrUr`rfrhrkrmrprqrrrsr r r r!r st o     )2,  Y     7=       &                                                                      r N)Zplyrr rZc_lexerrZ plyparserrrrrZast_transformsr r r r r r r! s   __pycache__/lextab.cpython-38.pyc000064400000015304147205113120012662 0ustar00U afj!@s"dZedZdZdZddddZddd d d d d dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddd!d"ddd#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNgfgdOddPdddQdddddddddddddddddRdSgfgdTddUdVdWgfgdZdXdXdXdZdYdZd[dZiZ dS)\z3.10)qANDANDEQUALARROWZAUTOZBREAKZCASEZCHAR CHAR_CONSTCOLONCOMMACONDOPZCONSTCONTINUEDEFAULTDIVEQUALDIVIDEZDOZDOUBLEELLIPSISELSEZENUMEQEQUALSZEXTERNFLOAT FLOAT_CONSTZFORGEZGOTOGTHEX_FLOAT_CONSTIDZIFZINLINEINT INT_CONST_BININT_CONST_CHAR INT_CONST_DEC INT_CONST_HEX INT_CONST_OCTLANDLBRACELBRACKETLELNOTLONGLORLPARENLSHIFT LSHIFTEQUALLTMINUS MINUSEQUAL MINUSMINUSMODMODEQUALNENOTZOFFSETOFOROREQUALPERIODPLUS PLUSEQUALPLUSPLUSPPHASHPPPRAGMAZ PPPRAGMASTRRBRACERBRACKETZREGISTERZRESTRICTZRETURNRPARENRSHIFT RSHIFTEQUALSEMIZSHORTZSIGNEDZSIZEOFZSTATICSTRING_LITERALZSTRUCTZSWITCHTIMES TIMESEQUALZTYPEDEFZTYPEID U16CHAR_CONSTU16STRING_LITERAL U32CHAR_CONSTU32STRING_LITERAL U8CHAR_CONSTU8STRING_LITERALZUNIONZUNSIGNEDZVOIDZVOLATILE WCHAR_CONSTZWHILEWSTRING_LITERALXORXOREQUALZ_ALIGNASZ_ALIGNOFZ_ATOMICZ_BOOLZ_COMPLEXZ _NORETURNZ_PRAGMAZ_STATIC_ASSERTZ _THREAD_LOCALZ__INT128@Z inclusiveZ exclusive)ZINITIALZpplineZpppragmaa (?P[ \t]*\#)|(?P\n+)|(?P\{)|(?P\})|(?P((((([0-9]*\.[0-9]+)|([0-9]+\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\.[0-9a-fA-F]+)|([0-9a-fA-F]+\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P'([^'\\\n]|(\\(([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))|(\d+)(?!\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F])))){2,4}')|(?P'([^'\\\n]|(\\(([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))|(\d+)(?!\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))')|(?PL'([^'\\\n]|(\\(([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))|(\d+)(?!\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))')|(?Pu8'([^'\\\n]|(\\(([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))|(\d+)(?!\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))')|(?Pu'([^'\\\n]|(\\(([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))|(\d+)(?!\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))')|(?PU'([^'\\\n]|(\\(([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))|(\d+)(?!\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))')|(?P('([^'\\\n]|(\\(([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))|(\d+)(?!\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*\n)|('([^'\\\n]|(\\(([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))|(\d+)(?!\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))*$))|(?P('([^'\\\n]|(\\(([a-wyzA-Z._~!=&\^\-\\?'"]|x(?![0-9a-fA-F]))|(\d+)(?!\d)|(x[0-9a-fA-F]+)(?![0-9a-fA-F]))))[^' ]+')|('')|('([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-9])[^'\n]*'))|(?PL"([^"\\\n]|(\\[0-9a-zA-Z._~!=&\^\-\\?'"]))*")|(?Pu8"([^"\\\n]|(\\[0-9a-zA-Z._~!=&\^\-\\?'"]))*")|(?Pu"([^"\\\n]|(\\[0-9a-zA-Z._~!=&\^\-\\?'"]))*")|(?PU"([^"\\\n]|(\\[0-9a-zA-Z._~!=&\^\-\\?'"]))*")|(?P"([^"\\\n]|(\\[0-9a-zA-Z._~!=&\^\-\\?'"]))*([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-9])([^"\\\n]|(\\[0-9a-zA-Z._~!=&\^\-\\?'"]))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\n]|(\\[0-9a-zA-Z._~!=&\^\-\\?'"]))*")|(?P\.\.\.)|(?P\|\|)|(?P\+\+)|(?P<<=)|(?P\|=)|(?P\+=)|(?P>>=)|(?P\*=)|(?P\^=)|(?P&=)|(?P->)|(?P\?)|(?P/=)|(?P==)|(?P>=)|(?P&&)|(?P\[)|(?P<=)|(?P\()|(?P<<)|(?P-=)|(?P--)|(?P%=)|(?P!=)|(?P\|)|(?P\.)|(?P\+)|(?P\])|(?P\))|(?P>>)|(?P\*)|(?P\^)|(?P&)|(?P:)|(?P,)|(?P/)|(?P=)|(?P>)|(?P!)|(?P<)|(?P-)|(?P%)|(?P~)|(?P;)N)Zt_PPHASHr4)Z t_NEWLINENEWLINE)Zt_LBRACEr)Zt_RBRACEr6)Z t_FLOAT_CONSTr)Zt_HEX_FLOAT_CONSTr)Zt_INT_CONST_HEXr)Zt_INT_CONST_BINr)Zt_BAD_CONST_OCTZ BAD_CONST_OCT)Zt_INT_CONST_OCTr)Zt_INT_CONST_DECr)Zt_INT_CONST_CHARr)Z t_CHAR_CONSTr)Z t_WCHAR_CONSTrE)Zt_U8CHAR_CONSTrC)Zt_U16CHAR_CONSTr?)Zt_U32CHAR_CONSTrA)Zt_UNMATCHED_QUOTEZUNMATCHED_QUOTE)Zt_BAD_CHAR_CONSTZBAD_CHAR_CONST)Zt_WSTRING_LITERALrF)Zt_U8STRING_LITERALrD)Zt_U16STRING_LITERALr@)Zt_U32STRING_LITERALrB)Zt_BAD_STRING_LITERALZBAD_STRING_LITERAL)Zt_IDr)Nr<)Nr )Nr")Nr3)Nr%)Nr/)Nr2)Nr:)Nr>)NrH)Nr)Nr)Nr)Nr )Nr)Nr)Nr)Nr)Nr)Nr#)Nr$)Nr()Nr))Nr+)Nr,)Nr.)Nr0)Nr1)Nr7)Nr8)Nr9)Nr=)NrG)Nr)Nr)Nr)Nr )Nr)Nr)Nr )Nr&)Nr')Nr*)Nr-)Nr;a*(?P"([^"\\\n]|(\\[0-9a-zA-Z._~!=&\^\-\\?'"]))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\n)|(?Pline))Zt_ppline_FILENAMEZFILENAME)Zt_ppline_LINE_NUMBERZ LINE_NUMBER)Zt_ppline_NEWLINErK)Zt_ppline_PPLINEZPPLINEzQ(?P\n)|(?Ppragma)|(?P.+))Zt_pppragma_NEWLINErK)Zt_pppragma_PPPRAGMAr5)Zt_pppragma_STRZSTRz Zt_errorZt_ppline_errorZt_pppragma_error) Z _tabversionsetZ _lextokensZ _lexreflagsZ _lexliteralsZ _lexstateinfoZ _lexstatereZ_lexstateignoreZ_lexstateerrorfZ _lexstateeoffrMrMA/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/lextab.pys   __pycache__/plyparser.cpython-38.pyc000064400000011072147205113120013422 0ustar00U af @sTddlZGdddeZGdddeZGdddeZdd Zd d Zd d ZdS)Nc@s&eZdZdZdZdddZddZdS) Coordz Coordinates of a syntactic element. Consists of: - File name - Line number - (optional) column number, for the Lexer )filelinecolumn __weakref__NcCs||_||_||_dSNrrr)selfrrrr D/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/plyparser.py__init__szCoord.__init__cCs(d|j|jf}|jr$|d|j7}|S)Nz%s:%sz:%sr)r strr r r __str__sz Coord.__str__)N)__name__ __module__ __qualname____doc__ __slots__r rr r r r r s rc@s eZdZdS) ParseErrorN)rrrr r r r rsrc@s.eZdZddZd ddZddZdd ZdS) PLYParsercCs<|d}dd}d||f|_d||_t|j|j|dS)z Given a rule name, creates an optional ply.yacc rule for it. The name of the optional rule is _opt Z_optcSs|d|d<dS)Nrr r pr r r optrule*sz+PLYParser._create_opt_rule..optrulez%s : empty | %szp_%sN)rrsetattr __class__)r Zrulenameoptnamerr r r _create_opt_rule#s  zPLYParser._create_opt_ruleNcCst|jj||dS)Nr)rZclexfilename)r linenorr r r _coord1s zPLYParser._coordcCsF|jjjdd||}|dkr&d}|||}||||S)z Returns the coordinates for the YaccProduction object 'p' indexed with 'token_idx'. The coordinate includes the 'lineno' and 'column'. Both follow the lex semantic, starting from 1.  r)lexerZlexdatarfindZlexposr r)r rZ token_idxZlast_crrr r r _token_coord7s zPLYParser._token_coordcCstd||fdS)Nz%s: %s)r)r msgZcoordr r r _parse_errorBszPLYParser._parse_error)N)rrrrr r%r'r r r r r"s  rcsfdd}|S)a Decorator to create parameterized rules. Parameterized rule methods must be named starting with 'p_' and contain 'xxx', and their docstrings may contain 'xxx' and 'yyy'. These will be replaced by the given parameter tuples. For example, ``p_xxx_rule()`` with docstring 'xxx_rule : yyy' when decorated with ``@parameterized(('id', 'ID'))`` produces ``p_id_rule()`` with the docstring 'id_rule : ID'. Using multiple tuples produces multiple rules. cs |_|Sr)_params)Z rule_funcparamsr r decoratePszparameterized..decorater )r*r+r r)r parameterizedFs r,cCsld}t|D]Z}|dr t||}t|dr t|||jdk rNt||q |s tjdt ddd}q |S) z Class decorator to generate rules from parameterized rule templates. See `parameterized` for more information on parameterized rules. FZp_r(Nz@parsing methods must have __doc__ for pycparser to work properly) stacklevelT) dir startswithgetattrhasattrdelattrr_create_param_ruleswarningswarnRuntimeWarning)clsZissued_nodoc_warning attr_namemethodr r r templateVs        r;csVjD]J\}}fdd}jd|d||_jd||_t||j|qdS)a Create ply.yacc rules based on a parameterized rule function Generates new methods (one per each pair of parameters) based on the template rule function `func`, and attaches them to `cls`. The rule function's parameters must be accessible via its `_params` attribute. cs||dSrr rfuncr r param_rule}sz'_create_param_rules..param_rulexxxyyyN)r(rreplacerr)r8r=r?r@r>r r<r r4ts  r4) r5objectr Exceptionrrr,r;r4r r r r  s $__pycache__/yacctab.cpython-38.pyc000064400000521506147205113120013017 0ustar00U afJ3y@sdZdZdZddddddd d d d d ddddddddddddgdddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/gfddddd d d d d d0d1ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWddXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdddkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'dd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJg0d d dddd d!d"d#ddd$d%dKddddLdMdddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dddSdadldmdndodpdqdrdadsdtdudvdwdxdyd'd(dzd{d|d}dd~ddddSddddddddddddd)ddldddddddddddddddddddddddddddddddddddd*ddddddddddddddddddddddddddddd+ddddd,dd-dŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdddddՐd֐dאddؐdِdڐdېdܐdݐdސdߐdddd.dddddddddd!ddd"ddddddddddddddddddddddddddddddddd d d d dd ddddd4ddddddddd/dddddddd d!ddddd"d#d$d%d&d'ddd(d)d*d+d,ddFd-d.d/ddd0d1g0fddddd d d d d ddddddddddddgdddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/gfddddd d d d d dddddd}ddddddddddddddddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJgPdddddd d!d"d#d$d%d&d'd(ddd)dddddd*dddddddddddddddd+d,d-dddd.ddddddddddd d dd ddddd/d!dddd'ddd(d)dd.d/ddd0d1gPfddddd d d d d dddddd}ddddddddddddddddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJgPd2d2dddd d!d"d#d$d%d&d'd(dd2d)d2d2d2d2dd*ddd2dddddddddddd2d+d,d-d2d2dd.dd2d2dd2dddddd d d2d ddddd/d!d2d2d2d'ddd(d)d2d.d/d2d2d0d1gPfddddd d d d d dddddd}dddddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJgEd3d3dddd d!d"d#d$d%d&d'd(dd)d3d*d3dddddddddddd3d+d,d-d.dd3d3dd3dddddd d3d ddddd/d!d3d3d3d'ddd(d)d3d.d/d3d3d0d1gEfddddd d d d d d0ddd4d5d3d4d5d6d7d8d9d;d6dd?d@d7d8dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWd9d:ddXdYdZd[d]d^d_d`dad;dcdd?dldmdndodpdqdrdtdyd@dAdBdCdzd{d|dDd}d~ddEdddFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^dddddddddddddddddd_d`ddadddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddՐddddddddߐdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"dddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"ddddBd*dEdFdGdHdIdJg$d:d:dddd d!d"d#d:d$d%d:d:ddddLdMd:ddOddPdQdRdSdTd{d~dUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkddd&d:d:dSdadmdndodpdqd:dad:d'd(dddd{d|d}dd~dddSdddddddddÐddddd)dd:dddddĐdŐdƐddddddȐddddd:d:ddʐdːdÐdÐdd*d:dddddddddddddddddddd+ddddd,d-dddddddddddddddddddddd dddddddd:d:ddӐdddԐdՐd֐dؐdِdddߐdddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dddddddddddd:dddddd d:dd dd dddddddddd/dddddddĐd!dddddddאdddd'ddd(d)ddddddd.d/ddd0d1g$fddddd d d d d d0ddd2d4d3d2d5d3d4d5d6d7d8d9d:d;d6dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdddXdYdZd[d]d^d_d`dad;dcddkdldmdndodpdqdrdtddyd@dAdBdCdzd{d|d}d~ddEddddFdGdHdddJddKdLdMdNddOdPdQdRddddSdTdddddddddddddddddddddUdVdWdXdYdZd[d\dddddddddddddddddddd_dߐd`ddddddddbdcdddeddddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzddȐd}d~ddddАdddddҐdddddddՐdddddddߐddddddddddddddddddddddddddddddddddddddddddddddd d d dddddddddddddddddddddddd d!d"ddd%d&dddd(d)dd,d-dddddddd0d1d2d3dd4ddd7d8dddddddddd:d;d<d=d>d"d@ddAddddBd*dDdddEdFdGdHdIdJgqd4d4dddd d!d"d#dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWddXdYdZd[d]d^d_d`dadcddldmdndodpdqdrdtdyd@dAdBdCdzd{d|d}d~ddEdddFdGdHddJddddKdLdMdNdddOdPdQdRdddSdTddddddddddddddddddddUdVdWdXdYdZd\dddddddddddddddddddd_d`dddddbdcdddeddddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzdddɐd}ddd̐d~ddddАddddddՐdddddddߐdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d dddddddddddddddddd d!d"ddd'dddd(d)dd*d+ddddd0d1d2d3dd4dddddd:d;d<d=d>d"d@ddAddBd*dDdEdFdGdHdIdJgWd6d6dddd d!d"d#d6d$d%d6ddddLdMd6ddOddPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&d6d6dSdadmdndodpdqdad6d'd(dKdd{d|d}dd~dddSdd6ddddddddddKd)dKd6dKdddKddgddĐdŐdƐdǐdddKdKdKdKdddȐdɐddddddddddddddddddddddd6d6dKdːdd*d6ddd6dKdddddddddddddKdKdKdKdd+ddddd,dd-dKdKdKdKdKdKdKdKdKdKdKdKdKdKdKdKdKdKdKdKdKdŐdƐdǐdKdȐdɐdʐdKdːd̐d͐dΐdĐdKdKd6d dӐdKdԐdՐd֐dؐdِdڐdKdߐdd6ddd.ddKdKddKdKdKdKdKdddKddddKd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdKdؐdKdĐdKdKdKdddddgdgdgdgdgdgdgdgdgdgdgdgdgdgdgdddddddKddddd d6dKd dKd dKdddKddddِddd/dKdddKddddddĐd!dKdKdKdKdKdKdאdĐdKdKd'ddd(d)dKd+dd,dKdKdKd-d.d/dKdKd0d1gWfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;d6dd?d@d7d8dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWd9d:dd ddXdYdZd[d\d]d^d_d`dad;dcddEdFdIdJgd@d@dddd d!d"d#d@djd$d%dKddddLdMd@ddNdOddPdQdRdSdTd|ddUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkddd&d@ddjd@dSdad@dmdndodpdqdjdadjd'd(d@dzd{d|d}dd~dddSdddddddddddd@d@d@d)d@ddjd@dd@dd@djdʐdd@d@d@ddd*djdddd@dd@dddddddddddd@d+d,d-d dd@d@d@d@dϐdd@dd@dd@dd@dՐd֐dאdؐdِdڐdߐdd@ddd.ddddd@dddddd@d@dddd d djd d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d ddd2d3d4d5d8d9d:d;d?dMdNdOdPdQdRdSdTdUdVdWdd ddYdZd[d\ddd?dkdldmdndodpdqdydCdzd}dddEddddIddJdd\ddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgd7d7dddd d!d"d#d7d$d%dKdddd7ddNdOddadbdcdddedfdgdhdidjdkd&d7dd7ddad7d'd(d7dzd{d|d}dd~dddddd7d7d7d)d7dd7dd7d7dːd7d7d7dd*ddd7d7dddddddddddd7d+d,d-d7d7d7d7dϐdАd7d7d7d7dאdd7ddd.ddddd7dddddd7d7d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdAdAdddd d!d"d#dAdAd$d%dKddddLdMdAddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dAddAdAdSdadAdmdndodpdqdad'd(dAdzd{d|d}dd~dddSdddddddddAdAdAd)dAddAddAdAdAddAdAdAddd*dAddddAddAdAddddddddddddAd+d,d-dAdAdAdAdϐddAdAddAddAdՐd֐dאdؐdِdڐdߐddAddd.dddddAddddddAdAdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdBdBdddd d!d"d#dBdBd$d%dKddddLdMdBddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dBddBdBdSdadBdmdndodpdqdad'd(dBdzd{d|d}dd~dddSdddddddddBdBdBd)dBddBddBdBdBddBdBdBddd*dBddddBddBdBddddddddddddBd+d,d-dBdBdBdBdϐddBdBddBddBdՐd֐dאdؐdِdڐdߐddBddd.dddddBddddddBdBdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdCdCdddd d!d"d#dCdCd$d%dKddddLdMdCddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dCddCdCdSdadCdmdndodpdqdad'd(dCdzd{d|d}dd~dddSdddddddddCdCdCd)dCddCddCdCdCddCdCdCddd*dCddddCddCdCddddddddddddCd+d,d-dCdCdCdCdϐddCdCddCddCdՐd֐dאdؐdِdڐdߐddCddd.dddddCddddddCdCdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdDdDdddd d!d"d#dDdDd$d%dKddddLdMdDddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dDddDdDdSdadDdmdndodpdqdad'd(dDdzd{d|d}dd~dddSdddddddddDdDdDd)dDddDddDdDdDddDdDdDddd*dDddddDddDdDddddddddddddDd+d,d-dDdDdDdDdϐddDdDddDddDdՐd֐dאdؐdِdڐdߐddDddd.dddddDddddddDdDdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdEdEdddd d!d"d#dEdEd$d%dKddddLdMdEddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dEddEdEdSdadEdmdndodpdqdad'd(dEdzd{d|d}dd~dddSdddddddddEdEdEd)dEddEddEdEdEddEdEdEddd*dEddddEddEdEddddddddddddEd+d,d-dEdEdEdEdϐddEdEddEddEdՐd֐dאdؐdِdڐdߐddEddd.dddddEddddddEdEdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdFdFdddd d!d"d#dFdFd$d%dKddddLdMdFddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dFddFdFdSdadFdmdndodpdqdad'd(dFdzd{d|d}dd~dddSdddddddddFdFdFd)dFddFddFdFdFddFdFdFddd*dFddddFddFdFddddddddddddFd+d,d-dFdFdFdFdϐddFdFddFddFdՐd֐dאdؐdِdڐdߐddFddd.dddddFddddddFdFdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdGdGdddd d!d"d#dGdGd$d%dKddddLdMdGddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dGddGdGdSdadGdmdndodpdqdad'd(dGdzd{d|d}dd~dddSdddddddddGdGdGd)dGddGddGdGdGddGdGdGddd*dGddddGddGdGddddddddddddGd+d,d-dGdGdGdGdϐddGdGddGddGdՐd֐dאdؐdِdڐdߐddGddd.dddddGddddddGdGdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdHdHdddd d!d"d#dHdHd$d%dKddddLdMdHddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dHddHdHdSdadHdmdndodpdqdad'd(dHdzd{d|d}dd~dddSdddddddddHdHdHd)dHddHddHdHdHddHdHdHddd*dHddddHddHdHddddddddddddHd+d,d-dHdHdHdHdϐddHdHddHddHdՐd֐dאdؐdِdڐdߐddHddd.dddddHddddddHdHdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdIdIdddd d!d"d#dIdId$d%dKddddLdMdIddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dIddIdIdSdadIdmdndodpdqdad'd(dIdzd{d|d}dd~dddSdddddddddIdIdId)dIddIddIdIdIddIdIdIddd*dIddddIddIdIddddddddddddId+d,d-dIdIdIdIdϐddIdIddIddIdՐd֐dאdؐdِdڐdߐddIddd.dddddIddddddIdIdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdJdJdddd d!d"d#dJdJd$d%dKddddLdMdJddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dJddJdJdSdadJdmdndodpdqdad'd(dJdzd{d|d}dd~dddSdddddddddJdJdJd)dJddJddJdJdJddJdJdJddd*dJddddJddJdJddddddddddddJd+d,d-dJdJdJdJdϐddJdJddJddJdՐd֐dאdؐdِdڐdߐddJddd.dddddJddddddJdJdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdKdKdddd d!d"d#dKdKd$d%dKddddLdMdKddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dKddKdKdSdadKdmdndodpdqdad'd(dKdzd{d|d}dd~dddSdddddddddKdKdKd)dKddKddKdKdKddKdKdKddd*dKddddKddKdKddddddddddddKd+d,d-dKdKdKdKdϐddKdKddKddKdՐd֐dאdؐdِdڐdߐddKddd.dddddKddddddKdKdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd?dkdldmdndodpdqdrdtdydCdzd{d|d}d~ddddEddddIddJdXdd\dddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdLdLdddd d!d"d#dLdLd$d%dKddddLdMdLddNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dLddLdLdSdadLdmdndodpdqdad'd(dLdzd{d|d}dd~dddSdddddddddLdLdLd)dLddLddLdLdLddLdLdLddd*dLddddLddLdLddddddddddddLd+d,d-dLdLdLdLdϐddLdLddLddLdՐd֐dאdؐdِdڐdߐddLddd.dddddLddddddLdLdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d8d9d:d;d6dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdYdZd[d\d]d^d_d`dadcddd>d?dkdldmdndodpdqdrdtdydBdCdzd{d|d}d~ddddEddddHdIddJdVdWdXdd\dddddddddddddddddddddddddd`ddddeddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddddd!d"dd,d-ddd0d:d;d<d=d>dEdFdIdJgdMdMdddd d!d"d#d[dcd$d%dKd[d[d[dLdMdd[dNdOdcdPdQdRd[dTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&d[ddcdd[dad[dmdndodpdqdad'd(dcdMdzd{d|d}d[d~dddSddcddddddddMdMdMd)d[ddcdMddMdcdcdcdېddMdMdMddd*dcdddd[ddcd[ddddddddddddMd+dcdcd,d-dMdMdMdMdϐddMdMdcddMddMdՐd֐dאdؐdِdڐdߐddMddd.ddddd[ddddddcdMdMdddd d d d ddddd/dddcdcd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;d6dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd>d?dkdodrdtdBdCd{d|d}d~ddddEddddHdIddJdVdWdXd\dddddddddddddddddddddddddd`ddddeddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddddd!d"dd,d-ddd0d:d;d<d=d>dEdFdIdJgdNdNdddd d!d"d#dNdNd$d%dKdNdNdNdLdMdNdNdOdNdPdQdRdNdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dNddNdNdadNdmdndodpdqdad'd(dNdNdzdNddSdNdddddddNdNdNd)dNddNdNddNdNdNdNddNdNdNddd*dNddddNddNdNddddddddddddNd+dNdNd,d-dNdNdNdNdϐddNdNdNddNddNdՐd֐dאdؐdِdڐdߐddNddd.dddddNddddddNdNdNdddd d d d ddddd/dddNdNd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;d6dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd>d?dkdodrdtdBdCd{d|d}d~ddddEddddHdIddJdVdWdXd\dddddddddddddddddddddddddd`ddddeddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddddd!d"dd,d-ddd0d:d;d<d=d>dEdFdIdJgdOdOdddd d!d"d#dOdOd$d%dKdOdOdOdLdMdOdNdOdOdPdQdRdOdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dOddOdOdadOdmdndodpdqdad'd(dOdOdzdOddSdOdddddddOdOdOd)dOddOdOddOdOdOdOddOdOdOddd*dOddddOddOdOddddddddddddOd+dOdOd,d-dOdOdOdOdϐddOdOdOddOddOdՐd֐dאdؐdِdڐdߐddOddd.dddddOddddddOdOdOdddd d d d ddddd/dddOdOd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;d6dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd>d?dkdodrdtdBdCd{d|d}d~ddddEddddHdIddJdVdWdXd\dddddddddddddddddddddddddd`ddddeddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddddd!d"dd,d-ddd0d:d;d<d=d>dEdFdIdJgdPdPdddd d!d"d#dPdPd$d%dKdPdPdPdLdMdPdNdOdPdPdQdRdPdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dPddPdPdadPdmdndodpdqdad'd(dPdPdzdPddSdPdddddddPdPdPd)dPddPdPddPdPdPdPddPdPdPddd*dPddddPddPdPddddddddddddPd+dPdPd,d-dPdPdPdPdϐddPdPdPddPddPdՐd֐dאdؐdِdڐdߐddPddd.dddddPddddddPdPdPdddd d d d ddddd/dddPdPd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd?dkdodrdtd{d|d}d~dddddIddXdddddddddddddddddddҐdddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdQdQdddd d!d"d#dQdQd$d%dKdQdQdQdLdMdQdNdOdPdQdRdQdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dQddQdQdadQdmdndodpdqdad'd(dQdzdQddSdddddd)dQddQddQdd*dQdddddddddddd+d,d-dϐddQdQdӐdԐdՐd֐ddQddd.dddddQddddddQdQdddd d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd?dkdodrdtd{d|d}d~dddddIddXdddddddddddddddddddҐdddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdRdRdddd d!d"d#dRdRd$d%dKdRdRdRdLdMdRdNdOdPdQdRdRdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dRddRdRdadRdmdndodpdqdad'd(dRdzdRddSdddddd)dRddRddRdd*dRdddddddddddd+d,d-dϐddRdRdӐdԐdՐd֐ddRddd.dddddRddddddRdRdddd d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd>d?dkdodrdtdCd{d|d}d~dddddHdIddWdXd\ddddddddddddddddeddddҐddddddddddddddddddddddddddddddddd!d"dd,d-dd0d:d;d<d=d>dEdFdIdJgd;d;dddd d!d"d#d;d;d$d%dKd;d;d;dLdMd;dNdOdPdQdRd;dTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&d;dd;d;dad;dmdndodpdqdad'd(dVd;dzd;ddSddddddd)d;dddd;ddd;dːdd*d;dddddddddddd+dd,d-dϐdd;d;dӐdԐdՐd֐dd;ddd.ddddd;ddddddd;d;dddd d d ddddd/dddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd?dkdodrdtd{d|d}d~dddddIddXdddddddddddddddddddҐdddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdSdSdddd d!d"d#dSdSd$d%dKdSdSdSdLdMdSdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dSddSdSdadSdmdndodpdqdad'd(dSdzdSddSdddddd)dSddSddSdd*dSdddddddddddd+d,d-dϐddSdSdӐdԐdՐd֐ddSddd.dddddSddddddSdSdddd d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd?dkdodrdtd{d|d}d~dddddIddXdddddddddddddddddddҐdddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdTdTdddd d!d"d#dTdTd$d%dKdTdTdTdLdMdTdNdOdPdQdRdTdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dTddTdTdadTdmdndodpdqdad'd(dTdzdTddSdddddd)dTddTddTdd*dTdddddddddddd+d,d-dϐddTdTdӐdԐdՐd֐ddTddd.dddddTddddddTdTdddd d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd?dkdodrdtd{d|d}d~dddddIddXdddddddddddddddddddҐdddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdUdUdddd d!d"d#dUdUd$d%dKdUdUdUdLdMdUdNdOdPdQdRdUdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dUddUdUdadUdmdndodpdqdad'd(dUdzdUddSdddddd)dUddUddUdd*dUdddddddddddd+d,d-dϐddUdUdӐdԐdՐd֐ddUddd.dddddUddddddUdUdddd d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd?dkdodrdtd{d|d}d~dddddIddXdddddddddddddddddddҐdddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdVdVdddd d!d"d#dVdVd$d%dKdVdVdVdLdMdVdNdOdPdQdRdVdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dVddVdVdadVdmdndodpdqdad'd(dVdzdVddSdddddd)dVddVddVdd*dVdddddddddddd+d,d-dϐddVdVdӐdԐdՐd֐ddVddd.dddddVddddddVdVdddd d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd?dkdodrdtd{d|d}d~dddddIddXdddddddddddddddddddҐdddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdWdWdddd d!d"d#dWdWd$d%dKdWdWdWdLdMdWdNdOdPdQdRdWdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dWddWdWdadWdmdndodpdqdad'd(dWdzdWddSdddddd)dWddWddWdd*dWdddddddddddd+d,d-dϐddWdWdӐdԐdՐd֐ddWddd.dddddWddddddWdWdddd d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d d0ddd2d3d4d5d6d7d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdd ddXdZd[d\d]d^d_d`dadcddd?dkdodrdtd{d|d}d~ddddEddddIddJdXddddddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgdڐddddd d!d"d#dڐdd$d%dKdڐdڐdڐdLdMdڐdNdOdPdQdRdڐdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkd&dڐddڐdڐdadڐdmdndodpdqdad'd(dڐdzdڐddSddddddڐdڐdd)dڐddڐddڐdڐdڐdڐdڐddd*dڐdddddڐdڐddddddddddddd+d,d-dڐdڐdڐdڐdϐdАdڐdڐdӐdڐdԐdڐdՐd֐dאdؐdِdڐdߐddڐddd.dddddڐddddddڐdڐdddd d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d ddd2d3d4d5d8d9d:d;d?dMdNdOdPdQdRdSdTdUdVdWdd ddYdZd[d\ddd?dkdldmdndodpdqdydCdzd}dddEddddIddJdd\ddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgd9d9dddd d!d"d#d9d$d%dKdddd9ddNdOddadbdcdddedfdgdhdidjdkd&d9dd9ddad9d'd(d9dzd{d|d}dd~dddddd9d9d9d)d9dd9dd9d9dːd9d9d9dd*ddd9d9dddddddddddd9d+d,d-d9d9d9d9dϐdАd9d9d9d9dאdd9ddd.ddddd9dddddd9d9d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfddddd d d d d d ddd2d3d4d5d8d9d:d;d?dMdNdOdPdQdRdSdTdUdVdWdd ddYdZd[d\ddd?dkdldmdndodpdqdydCdzd}dddEddddIddJdd\ddddddddddddddddddddd`dddd}d~ddddҐdddddddddddddddddddddddddddd!d"dd,d-d0d:d;d<d=d>dEdFdIdJgd:d:dddd d!d"d#d:d$d%dKdddd:ddNdOddadbdcdddedfdgdhdidjdkd&d:dd:ddad:d'd(d:dzd{d|d}dd~dddddd:d:d:d)d:dd:dd:d:dːd:d:d:dd*ddd:d:dddddddddddd:d+d,d-d:d:d:d:dϐdАd:d:d:d:dאdd:ddd.ddddd:dddddd:d:d d d ddddd/ddd!d'ddd(d)d.d/d0d1gfd dd2d:d7d8d9d:ddd dd\dddkd{d|d}d~dddddGddZdddddddddddddd`ddbdddddddddddddddddddddddddddd!d"dddddd*d,d-d0d1d2d3ddd:d;d<d=d>ddBdEdFdGdHdIdJgcdd%dKdNd}d}ddd}ddddd'd(dzd}d}dd}d}d}dd}d}dd}d*d}dddddddddddd}d}dd,d-dϐdd.dd}d}dd}ddddddd}dd}ddd d}d d}dddddddd/d}d}ddd!d}d}d}d}dאd'ddd(d)dd}d.d/d}d}d0d1gcfdddd}dddddddddddddddddddddddddddddddddddddddddddddddddddddddddŐdbdddddddddddddАddddddddddddddd d!ddddddddddddddddddd d d d d ddd"d#ddddddd!d"d#d$dd$d'dd(d)d*d+d0d6d%d9d:d;d<d=d>d&d@ddAdDdEdFdIdJgd%d'd(ddddddddddddddddddddddddddddddddd'd(ddddd*dddd)d*dddddddddddddddd,dd-dŐdƐdǐdȐdɐdʐdːd̐d͐dddd+dddd.ddddddddd,d-ddddddddddddddddddddddddd.d/d d d ddddddddd0dd/ddddd!d#dd&d'ddd(d)d1d+dd,d-d.d/d0d1gfdddd}dddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJg8d%d'd(dd_d*d_dddddddddddd_d,d-d.dd_d_dd_dddddd d_d ddddd/d!d_d_d_d'ddd(d)d_d.d/d_d_d0d1g8fdddd}dddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJg8d%d'd(dd2d*d2dddddddddddd2d,d-d.dd2d2dd2dddddd d2d ddddd/d!d2d2d2d'ddd(d)d2d.d/d2d2d0d1g8fdddd}dddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJg8d%d'd(ddd*dߐddddddddddddd,d-d.ddߐdߐddߐdddddd dߐd ddddd/d!dߐdߐdߐd'ddd(d)dߐd.d/dߐdߐd0d1g8fdddd}dddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJg8d%d'd(ddd*dddddddddddddd,d-d.ddddddddddd dd ddddd/d!dddd'ddd(d)dd.d/ddd0d1g8fdddd}ddddddddddddddddddddddd3dddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJg9d%d'd(ddd*dddddddddddddd,d-d.dddddddddddd dd ddddd/d!dddd'ddd(d)dd.d/ddd0d1g9fdddd}dddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJg8d%d'd(ddd*dddddddddddddd,d-d.ddddddddddd dd ddddd/d!dddd'ddd(d)dd.d/ddd0d1g8fdddd}dddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJg8d%d'd(ddd*dddddddddddddd,d-d.ddddddddddd dd ddddd/d!dddd'ddd(d)dd.d/ddd0d1g8fdddd}dddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJg8d%d'd(ddad*daddddddddddddad,d-d.ddadaddadddddd dad ddddd/d!dadadad'ddd(d)dad.d/dadad0d1g8fdddd}dddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJg8d%d'd(ddd*dddddddddddddd,d-d.ddddddddddd dd ddddd/d!dddd'ddd(d)dd.d/ddd0d1g8fdddd}dddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJg8d%d'd(ddd*dddddddddddddd,d-d.ddddddddddd dd ddddd/d!dddd'ddd(d)dd.d/ddd0d1g8fdddd}dddddddddddddddddddddddddddddddddd!d"dd0d1d2d3d:d;d<d=d>dBdEdFdGdHdIdJg8d%d'd(ddd*dddddddddddddd,d-d.ddddddddddd dd ddddd/d!dddd'ddd(d)dd.d/ddd0d1g8fddNdOdPdcddd=d>dAdBdCd}dEddGdHddJddKdLdMdNddOdPdQdRdddSdTddddddddddddddddddddUdVdWdZd\ddddddddddddddd_d`dddbdcdddeddddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzddȐd}d~ddddАdddddddddddddddddddddddddddddddddddddddddddd d d ddddddddddddd d!d"dddddd(d)dddddd0d1d2d3dd4dddddd:d;d<d=d>d"d@ddAddBd*dDdEdFdGdHdIdJgd%dbdcdddad'd(dOddddddOdOdOdddOddĐdŐdƐddǐdOdOdOdOdddȐdɐddddddddddddddddddddOdddOdd*dOdddddddddddddOdOdOdOddOddd,dd-dOdOdOdOdOdOdOdOdOdOdOdOdOdOdOdOdOdOdOdOdOdŐdƐdOdOdːd̐d͐dΐdĐdOdOddOdOd.ddOdOddOdOdOdOdOdddOddddOd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdOdؐdOdĐdOdOdOddddddddOdOdOd dOd dOdddOdddddd/dOdddOdOdddĐd!dOdOdOdOdOdOdאdĐdOdOd'ddd(d)dOd+dd,dOdOdOd-d.d/dOdOd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHddJddKdLdMdNddOdPdQdRdddSdTddddddddddddddddddddUdVdWdZd\ddddddddddddddd_d`dddbdcdddeddddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzddȐd}d~ddddАdddddddddddddddddddddddddddddddddddddddddddd d d ddddddddddddd d!d"dddddd(d)dddddd0d1d2d3dd4dddddd:d;d<d=d>d"d@ddAddBd*dDdEdFdGdHdIdJgd%dbdcdddad'd(dPddddddPdPdPdddPddĐdŐdƐddȐdPdPdPdPdddȐdɐddddddddddddddddddddPdddPdd*dPdddddddddddddPdPdPdPddPddd,dd-dPdPdPdPdPdPdPdPdPdPdPdPdPdPdPdPdPdPdPdPdPdŐdƐdPdPdːd̐d͐dΐdĐdPdPddPdPd.ddPdPddPdPdPdPdPdddPddddPd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdPdؐdPdĐdPdPdPddddddddPdPdPd dPd dPdddPdddddd/dPdddPdPdddĐd!dPdPdPdPdPdPdאdĐdPdPd'ddd(d)dPd+dd,dPdPdPd-d.d/dPdPd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(dRddddddRdRdRddRdĐdŐdƐdǐdRdRdRdRdȐdɐdRdddRdd*dRddddddddddddRdRdRdRddRddd,d-dRdRdRdRdRdRdRdRdRdRdRdRdRdRdRdRdRdRdRdRdRdRdRdĐdRdRddRdRd.ddRdRddRdRdRdRdRdddRddddRd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdRdؐdRdĐdRdRdRddRdRdRd dRd dRdddRdddddd/dRdRdRdddĐd!dRdRdRdRdRdRdאdĐdRdRd'ddd(d)dRddRdRdRd.d/dRdRd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(dddddddܐdܐdddܐdĐdŐdƐdǐdܐdܐdܐdܐdȐdɐddddܐdd*dܐddddddddddddܐdܐdܐdddddd,d-dܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdܐdĐdܐdddܐdd.ddܐdܐddܐdܐdܐdܐdܐdddܐddddܐd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdܐdؐdܐdĐdܐdܐdddܐdܐdܐd dܐd dܐdddܐdddddd/dܐdܐddddĐd!dܐdܐdܐdܐdܐdܐdאdĐdܐdܐd'ddd(d)dddܐdܐdܐd.d/dܐdܐd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHddJddddKdLdMdNdddOdPdQdRdddSdTddddddddddddddddddddUdVdWdZd\ddddddddddddddd_d`ddddbdcdddeddddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzdddɐd}ddd̐d~ddddАdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddddddddddddd d!d"ddd'dddd(d)dd*d+ddddd0d1d2d3dd4dddddd:d;d<d=d>d"d@ddAddBd*dDdEdFdGdHdIdJgd%dbdcdddad'd(dNddddddNdNdNdddNddtddĐdŐdƐdǐdddNdNdNdNdddȐdɐddddddddddddddddddddNdddNdd*dNdddddddddddddNdNdNdNdddNddd,dd-dNdNdNdNdNdNdNdNdNdNdNdNdNdNdNdNdNdNdNdNdNdŐdƐdǐdNdȐdɐdʐdNdːd̐d͐dΐdĐdNdNddNdNd.ddNdNddNdNdNdNdNdddNddddNd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdNdؐdNdĐdNdNdNddddddddddddddddtdtdtdtdddddddNdNdNd dNd dNdddNddddِddd/dNdddNdddNdddĐd!dNdNdNdNdNdNdאdĐdNdNd'ddd(d)dNd+dd,dNdNdNd-d.d/dNdNd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHddJddddKdLdMdNdddOdPdQdRdddSdTddddddddddddddddddddUdVdWdZd\ddddddddddddddd_d`ddddbdcdddeddddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzdddɐd}ddd̐d~ddddАdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddddddddddddd d!d"ddd'dddd(d)dd*d+ddddd0d1d2d3dd4dddddd:d;d<d=d>d"d@ddAddBd*dDdEdFdGdHdIdJgd%dbdcdddad'd(dLddddddLdLdLdddLddjddĐdŐdƐdǐdddLdLdLdLdddȐdɐddddddddddddddddddddLdddLdd*dLdddddddddddddLdLdLdLdddLddd,dd-dLdLdLdLdLdLdLdLdLdLdLdLdLdLdLdLdLdLdLdLdLdŐdƐdǐdLdȐdɐdʐdLdːd̐d͐dΐdĐdLdLddLdLd.ddLdLddLdLdLdLdLdddLddddLd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdLdؐdLdĐdLdLdLdddddddjdjdjdjdjdjdjdjdjdjdjdjdjdddddddLdLdLd dLd dLdddLddddِddd/dLdddLdddLdddĐd!dLdLdLdLdLdLdאdĐdLdLd'ddd(d)dLd+dd,dLdLdLd-d.d/dLdLd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHddJddddKdLdMdNdddOdPdQdRdddSdTddddddddddddddddddddUdVdWdZd\ddddddddddddddd_d`ddddbdcdddeddddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzdddɐd}ddd̐d~ddddАdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddddddddddddd d!d"ddd'dddd(d)dd*d+ddddd0d1d2d3dd4dddddd:d;d<d=d>d"d@ddAddBd*dDdEdFdGdHdIdJgd%dbdcdddad'd(dMddddddMdMdMdddMddkddĐdŐdƐdǐdddMdMdMdMdddȐdɐddddddddddddddddddddMdddMdd*dMdddddddddddddMdMdMdMdddMddd,dd-dMdMdMdMdMdMdMdMdMdMdMdMdMdMdMdMdMdMdMdMdMdŐdƐdǐdMdȐdɐdʐdMdːd̐d͐dΐdĐdMdMddMdMd.ddMdMddMdMdMdMdMdddMddddMd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdMdؐdMdĐdMdMdMdddddddkdkdkdkdkdkdkdkdkdkdkdkdkdddddddMdMdMd dMd dMdddMddddِddd/dMdddMdddMdddĐd!dMdMdMdMdMdMdאdĐdMdMd'ddd(d)dMd+dd,dMdMdMd-d.d/dMdMd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(dSddddddSdSdSddSdĐdŐdƐdǐdSdSdSdSdȐdɐdSdddSdd*dSddddddddddddSdSdSdSddSddd,d-dSdSdSdSdSdSdSdSdSdSdSdSdSdSdSdSdSdSdSdSdSdSdSdĐdSdSddSdSd.ddSdSddSdSdSdSdSdddSddddSd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdSdؐdSdĐdSdSdSddSdSdSd dSd dSdddSdddddd/dSdSdSdddĐd!dSdSdSdSdSdSdאdĐdSdSd'ddd(d)dSddSdSdSd.d/dSdSd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(dTddddddTdTdTddTdĐdŐdƐdǐdTdTdTdTdȐdɐdTdddTdd*dTddddddddddddTdTdTdTddTddd,d-dTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdTdĐdTdTddTdTd.ddTdTddTdTdTdTdTdddTddddTd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdTdؐdTdĐdTdTdTddTdTdTd dTd dTdddTdddddd/dTdTdTdddĐd!dTdTdTdTdTdTdאdĐdTdTd'ddd(d)dTddTdTdTd.d/dTdTd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(dddddddݐdݐdddݐdĐdŐdƐdǐdݐdݐdݐdݐdȐdɐddddݐdd*dݐddddddddddddݐdݐdݐdddddd,d-dݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdݐdĐdݐdddݐdd.ddݐdݐddݐdݐdݐdݐdݐdddݐddddݐd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdݐdؐdݐdĐdݐdݐdddݐdݐdݐd dݐd dݐdddݐdddddd/dݐdݐddddĐd!dݐdݐdݐdݐdݐdݐdאdĐdݐdݐd'ddd(d)dddݐdݐdݐd.d/dݐdݐd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,d-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcdddd=d>dAdBdCd}dEddGdHd4ddJddKdLdMdNdOdPdQdRdSdTdUdVdWdZd\dddddddddddddd_d`dddbdcdddeddƐd5ddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddddddddddddddddddd6ddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddƐdddƐdĐdŐdƐddddddȐddddddd*ddddddddddddddddddddd,ddd-dddddddddddddddddddddddddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTddddddUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddАddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐdd͐dddddddddd*ddddddddddddddddddddd,d-ddddddddddddddddddddddddːd̐d͐dΐddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTddddddUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddАddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddΐdddddddddd*ddddddddddddddddddddd,d-ddddddddddddddddddddddddːd̐d͐dΐddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTddddddUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddАddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddϐdddddddddd*ddddddddddddddddddddd,d-ddddddddddddddddddddddddːd̐d͐dΐddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfddNdOdPdcddd=d>dAdBdCd}dEddGdHdJdKdLdMdNdOdPdQdRdSdTddddddUdVdWdZd\dddddddddddddd_d`dddbdcdddedddfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddАddddddddddddddddddddddddddddddddddddddddddddddddddddd d!d"ddddddddddd0d1d2d3dd4dddddd:d;d<d=d>d"dddBd*dEdFdGdHdIdJgd%dbdcdddad'd(ddddddddddddĐdŐdƐddddddȐddАdddddddddd*ddddddddddddddddddddd,d-ddddddddddddddddddddddddːd̐d͐dΐddddddd.ddddddddddddddddd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐ddddddddddddd dd dddddddddd/ddddddĐd!dddddddאdddd'ddd(d)dddddd.d/ddd0d1gfdddddddddddddddddddddddd!d"dd0d:d;d<d=d>dEdFdIdJg$d%d(d*dddddddd,d-d.ddddddd d ddddd/d!d'dBdd(d)d.d/d0d1g$fdgdgfd2d:d\dgdhdidjdkdxddddddddddddddddddddddddddddddddddddddddddddddҐd7d8dddd d d ddddd9d:d%d&d'd(d)d*d+d,d-d;d7d8d@dAdDgTdKdNdldGdwdxdydzdZdlddddddddddddddddddddddddddddd*ddddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdd<ddddddddddd=d>dddddddddd?d$d%d+d,d-gTfd2d6d7d:d;d6dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdNdOdPdQdRdSdTdUdVdWd\d]d^d_d`dadcdedfdgdhdidjdkdrdtdvdwdxd@dAdBdCd{d|d~dddddd@ddddddddddddddddddddddddddddAdBdCdDdXd[d\ddddddddddddddddddƐdEddddddddddddҐdFdGdHdddIdJddddԐdddՐdddddddddddddKddddd!ddddLddddddddddddddddd d dMdNd dOd d dddPdddQdRddddd"d#ddddSdddTdUd#d$d$d%d&d'd(d)d*d+d,d-dddd.d/d6d7d8d%d9dVdddddddWd&d@dAdddDdXddgdKdLdMdNdOddPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dbdcdddedfdgdhdidjdkdldmdndodpdqdadFdudvdwdxdydzddSdYdddddddddddldddd5ddddddddddddddddddddddddddddddYdZddʐdːdd'd(dd*ddddddddddddÐdĐddŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАd[d\d]d^d_d`daddbdѐdҐdddӐd+dԐdՐd֐dؐdِdڐddݐdސdߐddcd^dddddddddddddddddddddddddddddddddddddddedfdgdhddd.d/dd d dddddddd0dddddddddddddd d#d$d%dd&didddddddd1d+d,ddd-dd d gfd2d6d7d:d;d6dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdNdOdPdQdRdSdTdUdVdWd]d^d_d`dadcdidjdjd?dkdrdtd@dAdBdCd{d|d~dddkdId4ddd@ddddddddddddddddddddddddddddldmdAdndBdCdDdXd[d\dddddodސdpdqddddddrdsdƐdtdEdzddddddddddddҐdFdGdHdddIdJdddddddddddddKdddddddudvdddd6ddddddddddddddddd d dNd dOd d dddwdxdydddzdQdRdddd{d|dd}d~ddddddSdddTdUd#d%d&d'd(d)d*d+d,d-ddddddd7d8d9dVdddddddddWd"d@dAddd*ddDdddddgdKdLdMdNdOddPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dbdcdddedfdgdhdidjdkdmdndodpdqdadxdydddzddSddddddddddddddddddddddddddddddddddddddddddddҐddddYdZddʐdːdd*ddddddddddddddĐddd dŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАd[d\d]d^d_d`dadddbdӐdԐdՐd֐dؐdِdڐdߐddcdd^ddd.dddddddddddddddddddddddddd)ddddddddd*d+ddddedfdgdhdddd^ddddddd d1ddd2d3ddddddddddddddddd$d%d&didAddddddddCdd+d,ddddGd-dd d dHdgfd2d6d:dd@dAdBdCdDdEdFdGdHdIdJdKdLdNdOdPdcdhdidjdkdtd{d|d~ddddddddddddddddddddddddddddddddddddddd2ddddddddddddddddddddddddddddddddddLddddddddddddddddd d d d d dddddddddddd#d%d&d'd(d)d*d+d,d-d7d8d9d@dAdDgdKdLdNdPdQdRdTdUdVdWdXdYdZd[d\d]d^d_d`dbdcdddadwdxdydzdSdddddldddddddddddddddddddddddddddddddd*ddddddddddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdӐdԐdՐd֐dؐdِdڐddߐddddddddddddddddddddddddddddddddddddd dddddddddddddd$d%d&d+d,d-gfd2d6d7d:d;d6dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdNdOdPdQdRdSdTdUdVdWd]d^d_d`dadcdidjdkdrdtd@dAdBdCd{d|d}d~ddddddddddddddddddddddddddddXd[d\ddddddddbdddddddddҐddddddddddddddddddd7d8dddd d d ddddddddddddd9d:d%d&dd(d)d,d-dddd;d7d8ddddddddd@ddAdddDddddgd>dLdMdNdOddPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dbdcdddedfdgdhdidjdkdmdndodpdqdadHdyd>ddSddddddddddHddddydddddddddddddddddddddddʐdːdd*dddddddĐdŐdƐdːd̐d͐dΐdϐdАddddddӐdԐdՐd֐dؐdِdڐdߐddddddd<ddddddddddddddddd dd=d>ddddddddddd?d$d%ddddddddd+dd,ddd-dd d dgfdNdOdPdcd>dAdBdCdHdddddddddddddddddddddddddddddUdWd\dddddcdedddddddddddАddddddddddddddddddddddddd d dMd d d ddddddd dddd#dddd'd(d)d*d+dddddd9ddd@dAdddDdXgxdbdcdddaddddddddddddddddddddddddddddddddddddd*ddddddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddd%d&dddddddddddddddddddd(dddddd,d-dddddddd;d7d8ddddddddddd&ddd+d,ddd-dgxfd}dddddddddddddddddddddddddddbdddddddАd7d8dd d d dddd9d:dd(d)d;ddd@ddAdDddg:dddd{dddddddddddddddddddddd*dddĐdŐdƐdːd̐d͐dΐdd<dddddddd=d>dddd?ddd+dd,d-ddg:fddddddddddddddddddddddddddddddddddd d d ddd(d)d@dAdDg,ddd|dddddddddddddddddddddd*ddĐdŐdƐdːd̐d͐dΐddddddddd+d,d-g,fddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddfddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddddddddddddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddhddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddhdhdhdhdhdhdhdhdhdhdhdhdhdhdhddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddiddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddidididididididididididididididdddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddlddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddldldldldldldldldldldlddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddmddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddmdmdmdmdmdmdmdmdmdmdmddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddnddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddddndndndndndndnddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddoddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddddodododododododdddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddpddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddddpdpdpdpdpdpdpddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddqddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddddqdqdqdqdqdqdqddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddrddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddddddrdrdrdrdrddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddsddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddddddsdsdsdsdsddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIddduddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐddddddddddddddddddududdddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddvddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐddddddddddddddddvddvdvddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddwddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddddddddddwddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d ddd'd(d)d*d+d@dAdDgIdddxddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddddddddddddddddddddd+d,d-gIfddddddddddddddddddddddddddddddddddddddddd d d ddd'd(d)d*d+d@dAdDg5dddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddd+d,d-g5fddddddddddddddddddddddddddddddddddddddddd d d ddd'd(d)d*d+d@dAdDg5dddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddd+d,d-g5fddddddddddddddddddddddddddddddddddddddddd d d ddd'd(d)d*d+d@dAdDg5dddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddd+d,d-g5fddddddddddddddddddddddddddddddddddddddddd d d ddd'd(d)d*d+d@dAdDg5dddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddd+d,d-g5fddddddddddddddddddddddddddddddddddddddddd d d ddd'd(d)d*d+d@dAdDg5dddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddd+d,d-g5fddddddddddddddddddddddddddddddddddddddddd d d ddd'd(d)d*d+d@dAdDg5dddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddd+d,d-g5fddddddddddddddddddddddddddddddddddddddddd d d ddd'd(d)d*d+d@dAdDg5dddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddd+d,d-g5fddddddddddddddddddddddddddddddddddddddddd d d ddd'd(d)d*d+d@dAdDg5dddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddd+d,d-g5fddddddddddddddddddddddddddddddddddddddddd d d ddd'd(d)d*d+d@dAdDg5dddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddd+d,d-g5fddddddddddddddddddddddddddddddddddddddddd d d ddd'd(d)d*d+d@dAdDg5dddddddddddddddddddddddddd*dddĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdddddddddddd+d,d-g5fdgdzgfdrZiZeD]L\ZZeededD],\Z Z e ek}rriee <e ee e<}qV}q<[dgdgfdgdgfdd d0d3d4d5d8d9d6d?dXdYdZd\d>d?doddHdIdUdVdXdddddbdcdddddddddddddddd ddddd1d2d3d4d"ddBd*dGdHg:dddddmdmdmdudmdAdmdddudmddAdndmddAdnddAdIddIdddddAd}dAd}dddddAdnddd}ddddddAddddddddddg:fddgddgfddgddgfddd d d\dddgd d dddddd gfddgd d gfdddddddddddddddd1d2d3dBdGdHgd d ddddddddddddddd?dodBdddEddHdIdJdVdWdXdddddddd`ddded}d~dddddddؐdddddddg6d3d3d3d]d3d3d3d3dCd3d3d]d3d3dCd3d3d\dCdCdCd3dCd3dCdCd\d]dCdCdCdސd\dd3dCdCd\dCdCdCdCd3d3dCdCdCd3d3dCd3d3dCd\g6fddd d0d3d4d5d9d?d dXdZd\d?doddIdXdddddddgd4d4d4d^d4d4d4d4d4d4d^d4d4d4d4d4d4d^d4d4d4d4d4d4d4gfddd d0d3d4d5d9d?d dXdZd\d?doddIdXdddddddgd5d5d5d_d5d5d5d5d5d5d_d5d5d5d5d5d5d_d5d5d5d5d5d5d5gfddd d0d8d dXdYd\d?dddEddIdJdXddddddddd`d}d~ddddddؐddddg&d6d6d6d`d6d6d`d6d6d6d6d6d6d6d6d6d`d6d6d6d6dd6dd6d6d6d6d6d6d6d6d6d6d6d6d6d6g&fddd d8d dYd\d?dddEddIdJddddddd`d}d~ddddddؐddddg!d7d7d7drd7drd7d7dddd7d7ddrddddd7dddddd7d7ddd7d7d7d7g!fddd d3d4d5d9d?d dZd\d?doddIdddddddgd8d8dYdndndndndndYdndYddndYddYddddYddgfddd d0d3d4d5d9d?d dXdZd\d?dodddEddIdJdXddddddd`d}d~ddddddؐddddg)d9d9d9dad9d9d9d9d9d9dad9d9d9d9dddd9d9ddadddddd9dddddd9d9ddd9d9d9d9g)fddd d8d dYd\d?dddEddIdJddddddd`d}d~ddddddؐddddg!dd>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>d>g!fddd d3d4d5d8d9d?d dYdZd\d?dodddEddIdJddddddd`d}d~ddddddؐddddg(d?d?dZdodododtdododZdtdodZd?dodtdtdtdZd?dtdtdtdtdtdtdZdtdtdtdtdtd?d?dtdtd?dZd?d?g(fddd d8d dYd\d?dddEddIdJddddddd`d}d~ddddddؐddddg!d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8d8g!fd d\gddgfd d\gd d gfd0dXgdbdbgfd0dXgdedegfd0dXdFdYgdfdfddgfd0dXdFdYddgdgdgdgdgddgfd0dXd<dFdYddgdhdhdkdhdhdhdhgfd0dXd;d<dFdYddgdididdididididigfd3d4d5d9d?dZdogdldpdqdydzdzdzgfd8dYgdsdsgfd8dYgdvdvgfd8dYgdwdwgfd6d>dHdVdddddgd@dUdcdddddgfd6d>dddEdHdJdVdddd`ddd}d~dddddؐddgdBdWddddeddBdddddBdddddBddddBgfd7d8dd{d|d~ddddGdZdd`dddddddddd*d1d2d3ddBdGdHgdDddd]d^dddddbdbdddddddbdddddddddbdddgfddddd`dddddd1d2d3dBdGdHgdddddudddddddddddgfdd=dEddGdJdOdPdQdRdUdZdd_d`dddcd5dfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~dddddddddddddddddddddddd dddd1d2d3dd4dddd"ddBd*dGdHgSd4dddddddddddddddddd6ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgSfd=dEd_ddddgd@dqdd#ddd/gfd=dEddGdJdUdZdd_d`dddcdfdydzd}d~dddddddddddddddddddddd dddd1d2d3dd4dddd"ddBd*dGdHg9ddddddddddddddddddddddddddddddddddddddddd9ddddddddddddddddg9fd=dEddGdJdUdZdd_d`dddcdfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~dddddddddddddddddddddd dddd1d2d3dd4dddd"ddBd*dGdHgKddddddddddddddddddddddddddddddd d dddddddddddddddddddddddddddddddddddddddddddgKfd=dEddGdJdQdUdZdd_d`dddcdfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~dddddddddddddddddddddddd dddd1d2d3dd4dddd"ddBd*dGdHgNddddddddddddddddddddddddddddddddddddddddddddddddddddddd'ddddd'ddddddddddddddddddgNfd=dEddGdJdOdPdQdRdUdZdd_d`dddcdfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~dddddddddddddddddddddddd dddd1d2d3dd4dddd"ddBd*dGdHgQdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgQfd=dEddGdJdOdPdQdRdUdZdd_d`dddcdfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~dddddddddddddddddddddddd dddd1d2d3dd4dddd"ddBd*dGdHgQdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgQfd=dEddGdJdOdPdQdRdUdZdd_d`dddcdfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~dddddddddddddddddddddddd dddd1d2d3dd4dddd"ddBd*dGdHgQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQdQgQfd=dEddGdJdOdPdQdRdUdZdd_d`dddcdfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~dddddddddddddddddddddddd dddd1d2d3dd4dddd"ddBd*dGdHgQdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgQfd=d?dEddGdIdJdOdPdQdRdUdZdd_d`dddcdfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~ddddddddddddddddddddddddddd ddddd1d2d3dd4dddd"dddBd*dGdHgXddDddddDdddddddddddddddddddddddddddddddddddddddRdddddddddddddd:ddddDdddddddddddddddddddddddddgXfd=dEddGdJdOdPdQdRdUdZdd_d`dddcdfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~dddddddddddddddddddddddd dddd1d2d3dd4dddd"ddBd*dGdHgQdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgQfd=dEddGdJdOdPdQdRdUdZdd_d`dddcdfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd}d~dddddddddddddddddddddddd dddd1d2d3dd4dddd"ddBd*dGdHgQdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgQfd?dIddddgdldrd~d~dd~gfd?dIdgdmdsdgfd?dIddddgdAdAdAdAdAdAgfd?dIdgdBdBdBgfd?dIdddddgdCdCdQdCdCdCdCgfdDd]d^gdddgfdDd]d^dgdddd"gfdddgdddgfddddddddddؐd dd%dgddddddddddd$d6d@dDgfddddddgddddddgfdddEdJdddd`d}d~ddddgddސdސdddddސdސdސdސdddgfddEdJd`d}d~ddgdodpdtdvdwdxdydPgfdgdgfdgdgfddgddgfdddddddd1d2d3dBdGdHg dddddddd;dddddg fdddddddd1d2d3dBdGdHg dddddddddddddg fdddddddd1d2d3dBdGdHg dddddddddddddg fdddddddd1d2d3dBdGdHg dddddddddddddg fdddddddd1d2d3dBdGdHg dddddddddddddg fdddddddd1d2d3dBdGdHg dddddddddddddg fddddddddd d1d2d3d4d"dBd*dGdHgddddddddd5dddd?dddddgfddJdd`dddfdyd}d~ddddddddd d1d2d3dd4d"ddBd*dGdHgddEddEdddLdMdEdEdddSdTdUddddddddWdddXddddgfddGdJdUdZdd`dddcdfdydzd}d~dddddddddddddddddd ddd1d2d3dd4dddd"ddBd*dGdHg1dddddddddddddOddddddddddddd#dŐdddddddVdddddddŐddddddddg1fdGdZddgddԐd$d&gfdUdcdddgdddddgfdXgdGgfdXdgdHdKgfdXdgddgfdXdސddgdJdJd{d{gfdXdސdddddgdddddddgfdgdgfdgdgfddgdd.gfddddd1d2d3dBdGdHg d3ddd0d:d=d>dEdIdJg fddddd1d2d3dBdGdHg ddddddddddg fdgdgfdbgd gfdbdgd!d%gfdbdddgddddgfdbdddgddddgfdbdddgd7d7d7d7gfdbd7dddgd8d9d8d8d8gfdzgdNgfdddgd|d|dgfdgdgfddZ iZ e D]L\ZZeededD],\Z Z e e krie e <e e e e<qjqP[ ddddddddddddddddddddddddddddddddÐdĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdؐdِdڐdېdܐdݐdސdߐdddddddddddddddddddddddddddddddddddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddÐdĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdؐdِdڐdېdܐdݐdސdߐdddddddddddddddddddddddddgUZ dS(z3.10ZLALRaStranslation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMODAUTO BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM EXTERN FLOAT FOR GOTO IF INLINE INT LONG REGISTER OFFSETOF RESTRICT RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH TYPEDEF UNION UNSIGNED VOID VOLATILE WHILE __INT128 _BOOL _COMPLEX _NORETURN _THREAD_LOCAL _STATIC_ASSERT _ATOMIC _ALIGNOF _ALIGNAS _PRAGMA ID TYPEID INT_CONST_DEC INT_CONST_OCT INT_CONST_HEX INT_CONST_BIN INT_CONST_CHAR FLOAT_CONST HEX_FLOAT_CONST CHAR_CONST WCHAR_CONST U8CHAR_CONST U16CHAR_CONST U32CHAR_CONST STRING_LITERAL WSTRING_LITERAL U8STRING_LITERAL U16STRING_LITERAL U32STRING_LITERAL PLUS MINUS TIMES DIVIDE MOD OR AND NOT XOR LSHIFT RSHIFT LOR LAND LNOT LT LE GT GE EQ NE EQUALS TIMESEQUAL DIVEQUAL MODEQUAL PLUSEQUAL MINUSEQUAL LSHIFTEQUAL RSHIFTEQUAL ANDEQUAL XOREQUAL OREQUAL PLUSPLUS MINUSMINUS ARROW CONDOP LPAREN RPAREN LBRACKET RBRACKET LBRACE RBRACE COMMA PERIOD SEMI COLON ELLIPSIS PPHASH PPPRAGMA PPPRAGMASTRabstract_declarator_opt : empty | abstract_declaratorassignment_expression_opt : empty | assignment_expressionblock_item_list_opt : empty | block_item_listdeclaration_list_opt : empty | declaration_listdeclaration_specifiers_no_type_opt : empty | declaration_specifiers_no_typedesignation_opt : empty | designationexpression_opt : empty | expressionid_init_declarator_list_opt : empty | id_init_declarator_listidentifier_list_opt : empty | identifier_listinit_declarator_list_opt : empty | init_declarator_listinitializer_list_opt : empty | initializer_listparameter_type_list_opt : empty | parameter_type_liststruct_declarator_list_opt : empty | struct_declarator_listtype_qualifier_list_opt : empty | type_qualifier_list direct_id_declarator : ID direct_id_declarator : LPAREN id_declarator RPAREN direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET direct_id_declarator : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET direct_id_declarator : direct_id_declarator LPAREN parameter_type_list RPAREN | direct_id_declarator LPAREN identifier_list_opt RPAREN direct_typeid_declarator : TYPEID direct_typeid_declarator : LPAREN typeid_declarator RPAREN direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET direct_typeid_declarator : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET direct_typeid_declarator : direct_typeid_declarator LPAREN parameter_type_list RPAREN | direct_typeid_declarator LPAREN identifier_list_opt RPAREN direct_typeid_noparen_declarator : TYPEID direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN id_declarator : direct_id_declarator id_declarator : pointer direct_id_declarator typeid_declarator : direct_typeid_declarator typeid_declarator : pointer direct_typeid_declarator typeid_noparen_declarator : direct_typeid_noparen_declarator typeid_noparen_declarator : pointer direct_typeid_noparen_declarator translation_unit_or_empty : translation_unit | empty translation_unit : external_declaration translation_unit : translation_unit external_declaration external_declaration : function_definition external_declaration : declaration external_declaration : pp_directive | pppragma_directive external_declaration : SEMI external_declaration : static_assert static_assert : _STATIC_ASSERT LPAREN constant_expression COMMA unified_string_literal RPAREN | _STATIC_ASSERT LPAREN constant_expression RPAREN pp_directive : PPHASH pppragma_directive : PPPRAGMA | PPPRAGMA PPPRAGMASTR | _PRAGMA LPAREN unified_string_literal RPAREN pppragma_directive_list : pppragma_directive | pppragma_directive_list pppragma_directive function_definition : id_declarator declaration_list_opt compound_statement function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement statement : labeled_statement | expression_statement | compound_statement | selection_statement | iteration_statement | jump_statement | pppragma_directive | static_assert pragmacomp_or_statement : pppragma_directive_list statement | statement decl_body : declaration_specifiers init_declarator_list_opt | declaration_specifiers_no_type id_init_declarator_list_opt declaration : decl_body SEMI declaration_list : declaration | declaration_list declaration declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt declaration_specifiers_no_type : atomic_specifier declaration_specifiers_no_type_opt declaration_specifiers_no_type : alignment_specifier declaration_specifiers_no_type_opt declaration_specifiers : declaration_specifiers type_qualifier declaration_specifiers : declaration_specifiers storage_class_specifier declaration_specifiers : declaration_specifiers function_specifier declaration_specifiers : declaration_specifiers type_specifier_no_typeid declaration_specifiers : type_specifier declaration_specifiers : declaration_specifiers_no_type type_specifier declaration_specifiers : declaration_specifiers alignment_specifier storage_class_specifier : AUTO | REGISTER | STATIC | EXTERN | TYPEDEF | _THREAD_LOCAL function_specifier : INLINE | _NORETURN type_specifier_no_typeid : VOID | _BOOL | CHAR | SHORT | INT | LONG | FLOAT | DOUBLE | _COMPLEX | SIGNED | UNSIGNED | __INT128 type_specifier : typedef_name | enum_specifier | struct_or_union_specifier | type_specifier_no_typeid | atomic_specifier atomic_specifier : _ATOMIC LPAREN type_name RPAREN type_qualifier : CONST | RESTRICT | VOLATILE | _ATOMIC init_declarator_list : init_declarator | init_declarator_list COMMA init_declarator init_declarator : declarator | declarator EQUALS initializer id_init_declarator_list : id_init_declarator | id_init_declarator_list COMMA init_declarator id_init_declarator : id_declarator | id_declarator EQUALS initializer specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid specifier_qualifier_list : specifier_qualifier_list type_qualifier specifier_qualifier_list : type_specifier specifier_qualifier_list : type_qualifier_list type_specifier specifier_qualifier_list : alignment_specifier specifier_qualifier_list : specifier_qualifier_list alignment_specifier struct_or_union_specifier : struct_or_union ID | struct_or_union TYPEID struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close | struct_or_union brace_open brace_close struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close | struct_or_union ID brace_open brace_close | struct_or_union TYPEID brace_open struct_declaration_list brace_close | struct_or_union TYPEID brace_open brace_close struct_or_union : STRUCT | UNION struct_declaration_list : struct_declaration | struct_declaration_list struct_declaration struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI struct_declaration : SEMI struct_declaration : pppragma_directive struct_declarator_list : struct_declarator | struct_declarator_list COMMA struct_declarator struct_declarator : declarator struct_declarator : declarator COLON constant_expression | COLON constant_expression enum_specifier : ENUM ID | ENUM TYPEID enum_specifier : ENUM brace_open enumerator_list brace_close enum_specifier : ENUM ID brace_open enumerator_list brace_close | ENUM TYPEID brace_open enumerator_list brace_close enumerator_list : enumerator | enumerator_list COMMA | enumerator_list COMMA enumerator alignment_specifier : _ALIGNAS LPAREN type_name RPAREN | _ALIGNAS LPAREN constant_expression RPAREN enumerator : ID | ID EQUALS constant_expression declarator : id_declarator | typeid_declarator pointer : TIMES type_qualifier_list_opt | TIMES type_qualifier_list_opt pointer type_qualifier_list : type_qualifier | type_qualifier_list type_qualifier parameter_type_list : parameter_list | parameter_list COMMA ELLIPSIS parameter_list : parameter_declaration | parameter_list COMMA parameter_declaration parameter_declaration : declaration_specifiers id_declarator | declaration_specifiers typeid_noparen_declarator parameter_declaration : declaration_specifiers abstract_declarator_opt identifier_list : identifier | identifier_list COMMA identifier initializer : assignment_expression initializer : brace_open initializer_list_opt brace_close | brace_open initializer_list COMMA brace_close initializer_list : designation_opt initializer | initializer_list COMMA designation_opt initializer designation : designator_list EQUALS designator_list : designator | designator_list designator designator : LBRACKET constant_expression RBRACKET | PERIOD identifier type_name : specifier_qualifier_list abstract_declarator_opt abstract_declarator : pointer abstract_declarator : pointer direct_abstract_declarator abstract_declarator : direct_abstract_declarator direct_abstract_declarator : LPAREN abstract_declarator RPAREN direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET direct_abstract_declarator : LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET direct_abstract_declarator : LBRACKET TIMES RBRACKET direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN block_item : declaration | statement block_item_list : block_item | block_item_list block_item compound_statement : brace_open block_item_list_opt brace_close labeled_statement : ID COLON pragmacomp_or_statement labeled_statement : CASE constant_expression COLON pragmacomp_or_statement labeled_statement : DEFAULT COLON pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement jump_statement : GOTO ID SEMI jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI | RETURN SEMI expression_statement : expression_opt SEMI expression : assignment_expression | expression COMMA assignment_expression assignment_expression : LPAREN compound_statement RPAREN typedef_name : TYPEID assignment_expression : conditional_expression | unary_expression assignment_operator assignment_expression assignment_operator : EQUALS | XOREQUAL | TIMESEQUAL | DIVEQUAL | MODEQUAL | PLUSEQUAL | MINUSEQUAL | LSHIFTEQUAL | RSHIFTEQUAL | ANDEQUAL | OREQUAL constant_expression : conditional_expression conditional_expression : binary_expression | binary_expression CONDOP expression COLON conditional_expression binary_expression : cast_expression | binary_expression TIMES binary_expression | binary_expression DIVIDE binary_expression | binary_expression MOD binary_expression | binary_expression PLUS binary_expression | binary_expression MINUS binary_expression | binary_expression RSHIFT binary_expression | binary_expression LSHIFT binary_expression | binary_expression LT binary_expression | binary_expression LE binary_expression | binary_expression GE binary_expression | binary_expression GT binary_expression | binary_expression EQ binary_expression | binary_expression NE binary_expression | binary_expression AND binary_expression | binary_expression OR binary_expression | binary_expression XOR binary_expression | binary_expression LAND binary_expression | binary_expression LOR binary_expression cast_expression : unary_expression cast_expression : LPAREN type_name RPAREN cast_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression | MINUSMINUS unary_expression | unary_operator cast_expression unary_expression : SIZEOF unary_expression | SIZEOF LPAREN type_name RPAREN | _ALIGNOF LPAREN type_name RPAREN unary_operator : AND | TIMES | PLUS | MINUS | NOT | LNOT postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN | postfix_expression LPAREN RPAREN postfix_expression : postfix_expression PERIOD ID | postfix_expression PERIOD TYPEID | postfix_expression ARROW ID | postfix_expression ARROW TYPEID postfix_expression : postfix_expression PLUSPLUS | postfix_expression MINUSMINUS postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close primary_expression : identifier primary_expression : constant primary_expression : unified_string_literal | unified_wstring_literal primary_expression : LPAREN expression RPAREN primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN offsetof_member_designator : identifier | offsetof_member_designator PERIOD identifier | offsetof_member_designator LBRACKET expression RBRACKET argument_expression_list : assignment_expression | argument_expression_list COMMA assignment_expression identifier : ID constant : INT_CONST_DEC | INT_CONST_OCT | INT_CONST_HEX | INT_CONST_BIN | INT_CONST_CHAR constant : FLOAT_CONST | HEX_FLOAT_CONST constant : CHAR_CONST | WCHAR_CONST | U8CHAR_CONST | U16CHAR_CONST | U32CHAR_CONST unified_string_literal : STRING_LITERAL | unified_string_literal STRING_LITERAL unified_wstring_literal : WSTRING_LITERAL | U8STRING_LITERAL | U16STRING_LITERAL | U32STRING_LITERAL | unified_wstring_literal WSTRING_LITERAL | unified_wstring_literal U8STRING_LITERAL | unified_wstring_literal U16STRING_LITERAL | unified_wstring_literal U32STRING_LITERAL brace_open : LBRACE brace_close : RBRACE empty :  @Z[ii iciiiiiiiiiiiiiiiiiiiiii#i  !"#&'()*+,-./0123456789:;<EFGHIJKLMNOQSTUVWXYabcdefghijklnopuvwyz{|ii#i$i%i'i(i)i,i-i.i/i7i8iFiGiJiMiNiOiPiQiRiSiTiUiViWiXiYiZi\i]iaibidieifihiiiqirisitiuiviwixiyiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i  i iiiiiiiii(i)i*+i,i.1i3i:i;i>iCDFiHiIiJiiiiiiiiiiiiiiiiiiiiiiizi}i|i{iiiiiiiiKiiiiiiiiiyiwiJiiiiiiiiiiiiiuisiiiWiViikijiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiihiai^i]ioimii%i'i&iiiiiiiiiiiiixivi?PR^_`qrstx~iiii i iiiiiiiiiiiiiiiiiii i!i"i&i*i2i5i6i:i>iBiCiKiLi[ijiminioizi{i|i}i~iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii !i2i4i5icibiIiiiGiiiiiiiHiFi i i i iiiiiiiiii7=mi?iDiEi_i`iiiiii"i#i$i%&i'i6i7iAiB\}i+i0iii.i(i*iii,i-i+i)iiiii CDi9iiABiiiiHiIiiiiii0iRiMiiQiiiPiLi9i8ipi iiiiii6i5i3i4i i;i<i=i@iAi^iiiiiiiiiii-i@iCi>iAi@i?i1ii/i2iiBi=ii0i]iiiikiliiiiiiiiiii iii=i?EiGiEiiiDiiiiiigi1i3i4iiiiiiiiii89)rz$endSEMIZPPHASHZPPPRAGMAZ_PRAGMAZ_STATIC_ASSERTZIDLPARENZTIMESZTYPEIDZENUMZVOIDZ_BOOLZCHARZSHORTINTLONGFLOATZDOUBLEZ_COMPLEXZSIGNEDZUNSIGNEDZ__INT128Z_ATOMICZCONSTZRESTRICTZVOLATILEZAUTOZREGISTERZSTATICZEXTERNZTYPEDEFZ _THREAD_LOCALZINLINEZ _NORETURNZ_ALIGNASZSTRUCTZUNIONLBRACERBRACEZCASEDEFAULTZIFZSWITCHZWHILEZDOZFORZGOTOZBREAKCONTINUEZRETURNZPLUSPLUSZ MINUSMINUSZSIZEOFZ_ALIGNOFANDPLUSMINUSZNOTZLNOTZOFFSETOFZ INT_CONST_DECZ INT_CONST_OCTZ INT_CONST_HEXZ INT_CONST_BINZINT_CONST_CHARZ FLOAT_CONSTZHEX_FLOAT_CONSTZ CHAR_CONSTZ WCHAR_CONSTZ U8CHAR_CONSTZ U16CHAR_CONSTZ U32CHAR_CONSTZSTRING_LITERALZWSTRING_LITERALZU8STRING_LITERALZU16STRING_LITERALZU32STRING_LITERALELSEZ PPPRAGMASTRZEQUALSCOMMARPARENCOLONLBRACKETRBRACKETZPERIODZARROWZCONDOPZDIVIDEZMODZRSHIFTZLSHIFTLTZLEZGEGTZEQZNEORZXORZLANDZLORZXOREQUALZ TIMESEQUALZDIVEQUALZMODEQUAL PLUSEQUALZ MINUSEQUALZ LSHIFTEQUALZ RSHIFTEQUALZANDEQUALZOREQUALELLIPSIS)dtranslation_unit_or_emptytranslation_unitemptyexternal_declarationfunction_definition declaration pp_directivepppragma_directive static_assert id_declaratordeclaration_specifiers decl_bodydirect_id_declaratorpointertype_qualifierstorage_class_specifierfunction_specifiertype_specifier_no_typeidtype_specifierdeclaration_specifiers_no_typealignment_specifier typedef_nameenum_specifierstruct_or_union_specifieratomic_specifierstruct_or_uniondeclaration_list_optdeclaration_listinit_declarator_list_optinit_declarator_listinit_declarator declaratortypeid_declaratordirect_typeid_declarator"declaration_specifiers_no_type_optid_init_declarator_list_optid_init_declarator_listid_init_declaratortype_qualifier_list_opttype_qualifier_list brace_opencompound_statementunified_string_literalconstant_expressionconditional_expressionbinary_expressioncast_expressionunary_expressionpostfix_expressionunary_operatorprimary_expression identifierconstantunified_wstring_literalparameter_type_listidentifier_list_optparameter_listidentifier_listparameter_declarationenumerator_list enumeratorstruct_declaration_list brace_closestruct_declarationspecifier_qualifier_list type_nameblock_item_list_optblock_item_list block_item statementlabeled_statementexpression_statementselection_statementiteration_statementjump_statementexpression_opt expressionassignment_expression initializerassignment_expression_opttypeid_noparen_declaratorabstract_declarator_opt direct_typeid_noparen_declaratorabstract_declaratordirect_abstract_declaratorstruct_declarator_list_optstruct_declarator_liststruct_declaratorpragmacomp_or_statementpppragma_directive_listassignment_operatorinitializer_list_optinitializer_listdesignation_opt designationdesignator_list designatorargument_expression_listparameter_type_list_optoffsetof_member_designator)zS' -> translation_unit_or_emptyzS'rNNN)z abstract_declarator_opt -> emptyrrp_abstract_declarator_opt plyparser.pyr*)z.abstract_declarator_opt -> abstract_declaratorrrrrr+)z"assignment_expression_opt -> emptyr}rp_assignment_expression_optrr*)z2assignment_expression_opt -> assignment_expressionr}rrrr+)zblock_item_list_opt -> emptyrprp_block_item_list_optrr*)z&block_item_list_opt -> block_item_listrprrrr+)zdeclaration_list_opt -> emptyrHrp_declaration_list_optrr*)z(declaration_list_opt -> declaration_listrHrrrr+)z+declaration_specifiers_no_type_opt -> emptyrPr$p_declaration_specifiers_no_type_optrr*)zDdeclaration_specifiers_no_type_opt -> declaration_specifiers_no_typerPrrrr+)zdesignation_opt -> emptyrrp_designation_optrr*)zdesignation_opt -> designationrrrrr+)zexpression_opt -> emptyryrp_expression_optrr*)zexpression_opt -> expressionryrrrr+)z$id_init_declarator_list_opt -> emptyrQrp_id_init_declarator_list_optrr*)z6id_init_declarator_list_opt -> id_init_declarator_listrQrrrr+)zidentifier_list_opt -> emptyrerp_identifier_list_optrr*)z&identifier_list_opt -> identifier_listrerrrr+)z!init_declarator_list_opt -> emptyrJrp_init_declarator_list_optrr*)z0init_declarator_list_opt -> init_declarator_listrJrrrr+)zinitializer_list_opt -> emptyrrp_initializer_list_optrr*)z(initializer_list_opt -> initializer_listrrrrr+)z parameter_type_list_opt -> emptyrrp_parameter_type_list_optrr*)z.parameter_type_list_opt -> parameter_type_listrrrrr+)z#struct_declarator_list_opt -> emptyrrp_struct_declarator_list_optrr*)z4struct_declarator_list_opt -> struct_declarator_listrrrrr+)z type_qualifier_list_opt -> emptyrTrp_type_qualifier_list_optrr*)z.type_qualifier_list_opt -> type_qualifier_listrTrrrr+)zdirect_id_declarator -> IDr:rZp_direct_id_declarator_1rr)z3direct_id_declarator -> LPAREN id_declarator RPARENr:rZp_direct_id_declarator_2rr)zpdirect_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKETr:rZp_direct_id_declarator_3rr)zsdirect_id_declarator -> direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKETr:rp_direct_id_declarator_4rr)zodirect_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKETr:rrrr)z\direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKETr:rZp_direct_id_declarator_5rr)zNdirect_id_declarator -> direct_id_declarator LPAREN parameter_type_list RPARENr:rp_direct_id_declarator_6rr)zNdirect_id_declarator -> direct_id_declarator LPAREN identifier_list_opt RPARENr:rrrr)z"direct_typeid_declarator -> TYPEIDrOrZp_direct_typeid_declarator_1rr)z;direct_typeid_declarator -> LPAREN typeid_declarator RPARENrOrZp_direct_typeid_declarator_2rr)zxdirect_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKETrOrZp_direct_typeid_declarator_3rr)z{direct_typeid_declarator -> direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKETrOrp_direct_typeid_declarator_4rr)zwdirect_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKETrOrrrr)zddirect_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKETrOrZp_direct_typeid_declarator_5rr)zVdirect_typeid_declarator -> direct_typeid_declarator LPAREN parameter_type_list RPARENrOrp_direct_typeid_declarator_6rr)zVdirect_typeid_declarator -> direct_typeid_declarator LPAREN identifier_list_opt RPARENrOrrrr)z*direct_typeid_noparen_declarator -> TYPEIDrrZ$p_direct_typeid_noparen_declarator_1rr)zdirect_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKETrrZ$p_direct_typeid_noparen_declarator_3rr)zdirect_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKETrr$p_direct_typeid_noparen_declarator_4rr)zdirect_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKETrrrrr)ztdirect_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKETrrZ$p_direct_typeid_noparen_declarator_5rr)zfdirect_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN parameter_type_list RPARENrr$p_direct_typeid_noparen_declarator_6rr)zfdirect_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN identifier_list_opt RPARENrrrrr)z%id_declarator -> direct_id_declaratorr7rZp_id_declarator_1rr)z-id_declarator -> pointer direct_id_declaratorr7rZp_id_declarator_2rr)z-typeid_declarator -> direct_typeid_declaratorrNrZp_typeid_declarator_1rr)z5typeid_declarator -> pointer direct_typeid_declaratorrNrZp_typeid_declarator_2rr)z=typeid_noparen_declarator -> direct_typeid_noparen_declaratorr~rZp_typeid_noparen_declarator_1rr)zEtypeid_noparen_declarator -> pointer direct_typeid_noparen_declaratorr~rZp_typeid_noparen_declarator_2rr)z-translation_unit_or_empty -> translation_unitr.rp_translation_unit_or_empty c_parser.pyr)z"translation_unit_or_empty -> emptyr.rrrr)z(translation_unit -> external_declarationr/rZp_translation_unit_1rr)z9translation_unit -> translation_unit external_declarationr/rZp_translation_unit_2rr)z+external_declaration -> function_definitionr1rZp_external_declaration_1rr)z#external_declaration -> declarationr1rZp_external_declaration_2rr)z$external_declaration -> pp_directiver1rp_external_declaration_3rr)z*external_declaration -> pppragma_directiver1rrrr)zexternal_declaration -> SEMIr1rZp_external_declaration_4rr)z%external_declaration -> static_assertr1rZp_external_declaration_5rr)z^static_assert -> _STATIC_ASSERT LPAREN constant_expression COMMA unified_string_literal RPARENr6rp_static_assert_declarationrr)zAstatic_assert -> _STATIC_ASSERT LPAREN constant_expression RPARENr6rrrr)zpp_directive -> PPHASHr4rZp_pp_directiverr)zpppragma_directive -> PPPRAGMAr5rp_pppragma_directiverr)z*pppragma_directive -> PPPRAGMA PPPRAGMASTRr5rrrr)zBpppragma_directive -> _PRAGMA LPAREN unified_string_literal RPARENr5rrrr)z-pppragma_directive_list -> pppragma_directiverrp_pppragma_directive_listriP)zEpppragma_directive_list -> pppragma_directive_list pppragma_directiverrrriQ)zLfunction_definition -> id_declarator declaration_list_opt compound_statementr2rZp_function_definition_1riX)zcfunction_definition -> declaration_specifiers id_declarator declaration_list_opt compound_statementr2rZp_function_definition_2rij)zstatement -> labeled_statementrsr p_statementriy)z!statement -> expression_statementrsrrriz)zstatement -> compound_statementrsrrri{)z statement -> selection_statementrsrrri|)z statement -> iteration_statementrsrrri})zstatement -> jump_statementrsrrri~)zstatement -> pppragma_directiversrrri)zstatement -> static_assertrsrrri)z pppragma_directive_list statementrrp_pragmacomp_or_statementri)z$pragmacomp_or_statement -> statementrrrri)z declaration_specifiers init_declarator_list_optr9r p_decl_bodyri)zGdecl_body -> declaration_specifiers_no_type id_init_declarator_list_optr9rrri)zdeclaration -> decl_body SEMIr3rZ p_declarationri)zdeclaration_list -> declarationrIrp_declaration_listri )z0declaration_list -> declaration_list declarationrIrrri )zSdeclaration_specifiers_no_type -> type_qualifier declaration_specifiers_no_type_optrArZ"p_declaration_specifiers_no_type_1ri)z\declaration_specifiers_no_type -> storage_class_specifier declaration_specifiers_no_type_optrArZ"p_declaration_specifiers_no_type_2ri)zWdeclaration_specifiers_no_type -> function_specifier declaration_specifiers_no_type_optrArZ"p_declaration_specifiers_no_type_3ri)zUdeclaration_specifiers_no_type -> atomic_specifier declaration_specifiers_no_type_optrArZ"p_declaration_specifiers_no_type_4ri&)zXdeclaration_specifiers_no_type -> alignment_specifier declaration_specifiers_no_type_optrArZ"p_declaration_specifiers_no_type_5ri+)z?declaration_specifiers -> declaration_specifiers type_qualifierr8rZp_declaration_specifiers_1ri0)zHdeclaration_specifiers -> declaration_specifiers storage_class_specifierr8rZp_declaration_specifiers_2ri5)zCdeclaration_specifiers -> declaration_specifiers function_specifierr8rZp_declaration_specifiers_3ri:)zIdeclaration_specifiers -> declaration_specifiers type_specifier_no_typeidr8rZp_declaration_specifiers_4ri?)z(declaration_specifiers -> type_specifierr8rZp_declaration_specifiers_5riD)zGdeclaration_specifiers -> declaration_specifiers_no_type type_specifierr8rZp_declaration_specifiers_6riI)zDdeclaration_specifiers -> declaration_specifiers alignment_specifierr8rZp_declaration_specifiers_7riN)zstorage_class_specifier -> AUTOr=rp_storage_class_specifierriS)z#storage_class_specifier -> REGISTERr=rrriT)z!storage_class_specifier -> STATICr=rrriU)z!storage_class_specifier -> EXTERNr=rrriV)z"storage_class_specifier -> TYPEDEFr=rrriW)z(storage_class_specifier -> _THREAD_LOCALr=rrriX)zfunction_specifier -> INLINEr>rp_function_specifierri])zfunction_specifier -> _NORETURNr>rrri^)z type_specifier_no_typeid -> VOIDr?rp_type_specifier_no_typeidric)z!type_specifier_no_typeid -> _BOOLr?rrrid)z type_specifier_no_typeid -> CHARr?rrrie)z!type_specifier_no_typeid -> SHORTr?rrrif)ztype_specifier_no_typeid -> INTr?rrrig)z type_specifier_no_typeid -> LONGr?rrrih)z!type_specifier_no_typeid -> FLOATr?rrrii)z"type_specifier_no_typeid -> DOUBLEr?rrrij)z$type_specifier_no_typeid -> _COMPLEXr?rrrik)z"type_specifier_no_typeid -> SIGNEDr?rrril)z$type_specifier_no_typeid -> UNSIGNEDr?rrrim)z$type_specifier_no_typeid -> __INT128r?rrrin)ztype_specifier -> typedef_namer@rp_type_specifierris)z type_specifier -> enum_specifierr@rrrit)z+type_specifier -> struct_or_union_specifierr@rrriu)z*type_specifier -> type_specifier_no_typeidr@rrriv)z"type_specifier -> atomic_specifierr@rrriw)z3atomic_specifier -> _ATOMIC LPAREN type_name RPARENrFrZp_atomic_specifierri})ztype_qualifier -> CONSTr<rp_type_qualifierri)ztype_qualifier -> RESTRICTr<rrri)ztype_qualifier -> VOLATILEr<rrri)ztype_qualifier -> _ATOMICr<rrri)z'init_declarator_list -> init_declaratorrKrp_init_declarator_listri)zBinit_declarator_list -> init_declarator_list COMMA init_declaratorrKrrri)zinit_declarator -> declaratorrLrp_init_declaratorri)z0init_declarator -> declarator EQUALS initializerrLrrri)z-id_init_declarator_list -> id_init_declaratorrRrp_id_init_declarator_listri)zHid_init_declarator_list -> id_init_declarator_list COMMA init_declaratorrRrrri)z#id_init_declarator -> id_declaratorrSrp_id_init_declaratorri)z6id_init_declarator -> id_declarator EQUALS initializerrSrrri)zMspecifier_qualifier_list -> specifier_qualifier_list type_specifier_no_typeidrnrZp_specifier_qualifier_list_1ri)zCspecifier_qualifier_list -> specifier_qualifier_list type_qualifierrnrZp_specifier_qualifier_list_2ri)z*specifier_qualifier_list -> type_specifierrnrZp_specifier_qualifier_list_3ri)z>specifier_qualifier_list -> type_qualifier_list type_specifierrnrZp_specifier_qualifier_list_4ri)z/specifier_qualifier_list -> alignment_specifierrnrZp_specifier_qualifier_list_5ri)zHspecifier_qualifier_list -> specifier_qualifier_list alignment_specifierrnrZp_specifier_qualifier_list_6ri)z/struct_or_union_specifier -> struct_or_union IDrErp_struct_or_union_specifier_1ri)z3struct_or_union_specifier -> struct_or_union TYPEIDrErrri)z[struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_closerErp_struct_or_union_specifier_2ri)zCstruct_or_union_specifier -> struct_or_union brace_open brace_closerErrri)z^struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_closerErp_struct_or_union_specifier_3ri)zFstruct_or_union_specifier -> struct_or_union ID brace_open brace_closerErrri)zbstruct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_closerErrri)zJstruct_or_union_specifier -> struct_or_union TYPEID brace_open brace_closerErrri)zstruct_or_union -> STRUCTrGrp_struct_or_unionri)zstruct_or_union -> UNIONrGrrri)z-struct_declaration_list -> struct_declarationrkrp_struct_declaration_listri)zEstruct_declaration_list -> struct_declaration_list struct_declarationrkrrri)zNstruct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMIrmrZp_struct_declaration_1ri )zstruct_declaration -> SEMIrmrZp_struct_declaration_2ri1)z(struct_declaration -> pppragma_directivermrZp_struct_declaration_3ri6)z+struct_declarator_list -> struct_declaratorrrp_struct_declarator_listri;)zHstruct_declarator_list -> struct_declarator_list COMMA struct_declaratorrrrri<)zstruct_declarator -> declaratorrrZp_struct_declarator_1riD)z9struct_declarator -> declarator COLON constant_expressionrrp_struct_declarator_2riI)z.struct_declarator -> COLON constant_expressionrrrriJ)zenum_specifier -> ENUM IDrDrp_enum_specifier_1riR)zenum_specifier -> ENUM TYPEIDrDrrriS)z=enum_specifier -> ENUM brace_open enumerator_list brace_closerDrZp_enum_specifier_2riX)z@enum_specifier -> ENUM ID brace_open enumerator_list brace_closerDrp_enum_specifier_3ri])zDenum_specifier -> ENUM TYPEID brace_open enumerator_list brace_closerDrrri^)zenumerator_list -> enumeratorrirp_enumerator_listric)z(enumerator_list -> enumerator_list COMMArirrrid)z3enumerator_list -> enumerator_list COMMA enumeratorrirrrie)z7alignment_specifier -> _ALIGNAS LPAREN type_name RPARENrBrp_alignment_specifierrip)zAalignment_specifier -> _ALIGNAS LPAREN constant_expression RPARENrBrrriq)zenumerator -> IDrjr p_enumeratorriv)z+enumerator -> ID EQUALS constant_expressionrjrrriw)zdeclarator -> id_declaratorrMr p_declaratorri)zdeclarator -> typeid_declaratorrMrrri)z(pointer -> TIMES type_qualifier_list_optr;r p_pointerri)z0pointer -> TIMES type_qualifier_list_opt pointerr;rrri)z%type_qualifier_list -> type_qualifierrUrp_type_qualifier_listri)z9type_qualifier_list -> type_qualifier_list type_qualifierrUrrri)z%parameter_type_list -> parameter_listrdrp_parameter_type_listri)z4parameter_type_list -> parameter_list COMMA ELLIPSISrdrrri)z'parameter_list -> parameter_declarationrfrp_parameter_listri$)z parameter_list COMMA parameter_declarationrfrrri%)z=parameter_declaration -> declaration_specifiers id_declaratorrhrp_parameter_declaration_1ri8)zIparameter_declaration -> declaration_specifiers typeid_noparen_declaratorrhrrri9)zGparameter_declaration -> declaration_specifiers abstract_declarator_optrhrZp_parameter_declaration_2riD)zidentifier_list -> identifierrgrp_identifier_listrid)z3identifier_list -> identifier_list COMMA identifierrgrrrie)z$initializer -> assignment_expressionr|rZp_initializer_1rin)z:initializer -> brace_open initializer_list_opt brace_closer|rp_initializer_2ris)z brace_open initializer_list COMMA brace_closer|rrrit)z/initializer_list -> designation_opt initializerrrp_initializer_listri|)zFinitializer_list -> initializer_list COMMA designation_opt initializerrrrri})z%designation -> designator_list EQUALSrrZ p_designationri)zdesignator_list -> designatorrrp_designator_listri)z-designator_list -> designator_list designatorrrrri)z3designator -> LBRACKET constant_expression RBRACKETrr p_designatorri)zdesignator -> PERIOD identifierrrrri)z=type_name -> specifier_qualifier_list abstract_declarator_optrorZ p_type_nameri)zabstract_declarator -> pointerrrZp_abstract_declarator_1ri)z9abstract_declarator -> pointer direct_abstract_declaratorrrZp_abstract_declarator_2ri)z1abstract_declarator -> direct_abstract_declaratorrrZp_abstract_declarator_3ri)z?direct_abstract_declarator -> LPAREN abstract_declarator RPARENrrZp_direct_abstract_declarator_1ri)zddirect_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKETrrZp_direct_abstract_declarator_2ri)zadirect_abstract_declarator -> LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKETrrZp_direct_abstract_declarator_3ri)zPdirect_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKETrrZp_direct_abstract_declarator_4ri)z5direct_abstract_declarator -> LBRACKET TIMES RBRACKETrrZp_direct_abstract_declarator_5ri)z^direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPARENrrZp_direct_abstract_declarator_6ri)zCdirect_abstract_declarator -> LPAREN parameter_type_list_opt RPARENrrZp_direct_abstract_declarator_7ri)zblock_item -> declarationrrr p_block_itemri)zblock_item -> statementrrrrri)zblock_item_list -> block_itemrqrp_block_item_listri )z-block_item_list -> block_item_list block_itemrqrrri )z@compound_statement -> brace_open block_item_list_opt brace_closerWrZp_compound_statement_1ri)z5labeled_statement -> ID COLON pragmacomp_or_statementrtrZp_labeled_statement_1ri)zKlabeled_statement -> CASE constant_expression COLON pragmacomp_or_statementrtrZp_labeled_statement_2ri)z:labeled_statement -> DEFAULT COLON pragmacomp_or_statementrtrZp_labeled_statement_3ri)zJselection_statement -> IF LPAREN expression RPAREN pragmacomp_or_statementrvrZp_selection_statement_1ri")zYselection_statement -> IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statementrvrZp_selection_statement_2ri&)zNselection_statement -> SWITCH LPAREN expression RPAREN pragmacomp_or_statementrvrZp_selection_statement_3ri*)zMiteration_statement -> WHILE LPAREN expression RPAREN pragmacomp_or_statementrwrZp_iteration_statement_1ri/)zUiteration_statement -> DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMIrwrZp_iteration_statement_2ri3)zwiteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statementrwr Zp_iteration_statement_3ri7)zoiteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statementrwr Zp_iteration_statement_4ri;)zjump_statement -> GOTO ID SEMIrxrZp_jump_statement_1ri@)zjump_statement -> BREAK SEMIrxrZp_jump_statement_2riD)zjump_statement -> CONTINUE SEMIrxrZp_jump_statement_3riH)z(jump_statement -> RETURN expression SEMIrxrp_jump_statement_4riL)zjump_statement -> RETURN SEMIrxrrriM)z+expression_statement -> expression_opt SEMIrurZp_expression_statementriR)z#expression -> assignment_expressionrzr p_expressionriY)z4expression -> expression COMMA assignment_expressionrzrrriZ)z9assignment_expression -> LPAREN compound_statement RPARENr{rZ#p_parenthesized_compound_expressionrif)ztypedef_name -> TYPEIDrCrZp_typedef_namerij)z/assignment_expression -> conditional_expressionr{rp_assignment_expressionrin)zSassignment_expression -> unary_expression assignment_operator assignment_expressionr{rrrio)zassignment_operator -> EQUALSrrp_assignment_operatorri|)zassignment_operator -> XOREQUALrrrri})z!assignment_operator -> TIMESEQUALrrrri~)zassignment_operator -> DIVEQUALrrrri)zassignment_operator -> MODEQUALrrrri)z assignment_operator -> PLUSEQUALrrrri)z!assignment_operator -> MINUSEQUALrrrri)z"assignment_operator -> LSHIFTEQUALrrrri)z"assignment_operator -> RSHIFTEQUALrrrri)zassignment_operator -> ANDEQUALrrrri)zassignment_operator -> OREQUALrrrri)z-constant_expression -> conditional_expressionrYrZp_constant_expressionri)z+conditional_expression -> binary_expressionrZrp_conditional_expressionri)zZconditional_expression -> binary_expression CONDOP expression COLON conditional_expressionrZrrri)z$binary_expression -> cast_expressionr[rp_binary_expressionri)z>binary_expression -> binary_expression TIMES binary_expressionr[rrri)z?binary_expression -> binary_expression DIVIDE binary_expressionr[rrri)z binary_expression MOD binary_expressionr[rrri)z=binary_expression -> binary_expression PLUS binary_expressionr[rrri)z>binary_expression -> binary_expression MINUS binary_expressionr[rrri)z?binary_expression -> binary_expression RSHIFT binary_expressionr[rrri)z?binary_expression -> binary_expression LSHIFT binary_expressionr[rrri)z;binary_expression -> binary_expression LT binary_expressionr[rrri)z;binary_expression -> binary_expression LE binary_expressionr[rrri)z;binary_expression -> binary_expression GE binary_expressionr[rrri)z;binary_expression -> binary_expression GT binary_expressionr[rrri)z;binary_expression -> binary_expression EQ binary_expressionr[rrri)z;binary_expression -> binary_expression NE binary_expressionr[rrri)z binary_expression AND binary_expressionr[rrri)z;binary_expression -> binary_expression OR binary_expressionr[rrri)z binary_expression XOR binary_expressionr[rrri)z=binary_expression -> binary_expression LAND binary_expressionr[rrri)z binary_expression LOR binary_expressionr[rrri)z#cast_expression -> unary_expressionr\rZp_cast_expression_1ri)z:cast_expression -> LPAREN type_name RPAREN cast_expressionr\rZp_cast_expression_2ri)z&unary_expression -> postfix_expressionr]rZp_unary_expression_1ri)z-unary_expression -> PLUSPLUS unary_expressionr]rp_unary_expression_2ri)z/unary_expression -> MINUSMINUS unary_expressionr]rrri)z2unary_expression -> unary_operator cast_expressionr]rrri)z+unary_expression -> SIZEOF unary_expressionr]rp_unary_expression_3ri)z2unary_expression -> SIZEOF LPAREN type_name RPARENr]rrri)z4unary_expression -> _ALIGNOF LPAREN type_name RPARENr]rrri)zunary_operator -> ANDr_rp_unary_operatorri)zunary_operator -> TIMESr_rrri)zunary_operator -> PLUSr_rrri)zunary_operator -> MINUSr_rrri)zunary_operator -> NOTr_rrri)zunary_operator -> LNOTr_rrri)z(postfix_expression -> primary_expressionr^rZp_postfix_expression_1ri)zEpostfix_expression -> postfix_expression LBRACKET expression RBRACKETr^rZp_postfix_expression_2ri)zOpostfix_expression -> postfix_expression LPAREN argument_expression_list RPARENr^rp_postfix_expression_3ri)z6postfix_expression -> postfix_expression LPAREN RPARENr^rrri)z2postfix_expression -> postfix_expression PERIOD IDr^rp_postfix_expression_4ri)z6postfix_expression -> postfix_expression PERIOD TYPEIDr^rrri)z1postfix_expression -> postfix_expression ARROW IDr^rrri)z5postfix_expression -> postfix_expression ARROW TYPEIDr^rrri)z1postfix_expression -> postfix_expression PLUSPLUSr^rp_postfix_expression_5ri)z3postfix_expression -> postfix_expression MINUSMINUSr^rrri)zUpostfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_closer^rp_postfix_expression_6ri)z[postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_closer^rrri)z primary_expression -> identifierr`rZp_primary_expression_1ri)zprimary_expression -> constantr`rZp_primary_expression_2ri)z,primary_expression -> unified_string_literalr`rp_primary_expression_3ri)z-primary_expression -> unified_wstring_literalr`rrri)z.primary_expression -> LPAREN expression RPARENr`rZp_primary_expression_4ri )zWprimary_expression -> OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPARENr`rZp_primary_expression_5ri)z(offsetof_member_designator -> identifierrrp_offsetof_member_designatorri)zJoffsetof_member_designator -> offsetof_member_designator PERIOD identifierrrrri)zUoffsetof_member_designator -> offsetof_member_designator LBRACKET expression RBRACKETrrrri)z1argument_expression_list -> assignment_expressionrrp_argument_expression_listri$)zPargument_expression_list -> argument_expression_list COMMA assignment_expressionrrrri%)zidentifier -> IDrarZ p_identifierri.)zconstant -> INT_CONST_DECrbr p_constant_1ri2)zconstant -> INT_CONST_OCTrbrrri3)zconstant -> INT_CONST_HEXrbrrri4)zconstant -> INT_CONST_BINrbrrri5)zconstant -> INT_CONST_CHARrbrrri6)zconstant -> FLOAT_CONSTrbr p_constant_2riI)zconstant -> HEX_FLOAT_CONSTrbrrriJ)zconstant -> CHAR_CONSTrbr p_constant_3riZ)zconstant -> WCHAR_CONSTrbrrri[)zconstant -> U8CHAR_CONSTrbrrri\)zconstant -> U16CHAR_CONSTrbrrri])zconstant -> U32CHAR_CONSTrbrrri^)z(unified_string_literal -> STRING_LITERALrXrp_unified_string_literalrii)z?unified_string_literal -> unified_string_literal STRING_LITERALrXrrrij)z*unified_wstring_literal -> WSTRING_LITERALrcrp_unified_wstring_literalrit)z+unified_wstring_literal -> U8STRING_LITERALrcrrriu)z,unified_wstring_literal -> U16STRING_LITERALrcrrriv)z,unified_wstring_literal -> U32STRING_LITERALrcrrriw)zBunified_wstring_literal -> unified_wstring_literal WSTRING_LITERALrcrrrix)zCunified_wstring_literal -> unified_wstring_literal U8STRING_LITERALrcrrriy)zDunified_wstring_literal -> unified_wstring_literal U16STRING_LITERALrcrrriz)zDunified_wstring_literal -> unified_wstring_literal U32STRING_LITERALrcrrri{)zbrace_open -> LBRACErVrZ p_brace_openri)zbrace_close -> RBRACErlrZ p_brace_closeri)zempty -> r0rZp_emptyriN)Z _tabversionZ _lr_methodZ _lr_signatureZ_lr_action_itemsZ _lr_actionitemsZ_kZ_vzip_xZ_yZ_lr_goto_itemsZ_lr_gotoZ_lr_productionsrrB/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/pycparser/yacctab.pys,