$46 GRAYBYTE WORDPRESS FILE MANAGER $63

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/lib/python3.6/site-packages/pycparser/

HOME
Current File : /usr/lib/python3.6/site-packages/pycparser//plyparser.py
#-----------------------------------------------------------------
# plyparser.py
#
# PLYParser class and other utilites for simplifying programming
# parsers with PLY
#
# Copyright (C) 2008-2015, Eli Bendersky
# License: BSD
#-----------------------------------------------------------------


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
            <rulename>_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 _parse_error(self, msg, coord):
        raise ParseError("%s: %s" % (coord, msg))

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.25 PM
root / root
0755
__pycache__
--
31 Aug 2024 3.39 AM
root / root
0755
__init__.py
2.835 KB
10 Jun 2015 10.00 AM
root / root
0644
_ast_gen.py
8.46 KB
10 Jun 2015 10.00 AM
root / root
0644
_build_tables.py
0.831 KB
10 Jun 2015 10.00 AM
root / root
0644
_c_ast.cfg
4.082 KB
10 Jun 2015 10.00 AM
root / root
0644
ast_transforms.py
3.484 KB
10 Jun 2015 10.00 AM
root / root
0644
c_ast.py
22.789 KB
13 Nov 2019 9.57 PM
root / root
0644
c_generator.py
13.252 KB
10 Jun 2015 10.00 AM
root / root
0644
c_lexer.py
14.106 KB
13 Nov 2019 9.57 PM
root / root
0644
c_parser.py
60.753 KB
13 Nov 2019 9.57 PM
root / root
0644
lextab.py
7.076 KB
13 Nov 2019 9.57 PM
root / root
0644
plyparser.py
1.557 KB
10 Jun 2015 10.00 AM
root / root
0644
yacctab.py
123.333 KB
13 Nov 2019 9.57 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF