import os
import sys

sys.path.insert(0, os.environ["QUEX_PATH"])

from quex.output.cpp.core import write_configuration_header
from quex.input.setup import setup as Setup
import quex.input.setup_parser as setup_parser
from quex.frs_py.file_in import open_file_or_die
import quex.input.quex_file_parser as quex_file_parser


setup_parser.do(["-i", "nothing", "-o", "TestAnalyzer", "--token-policy", "single", "--no-include-stack"])

# Parse default token file
fh = open_file_or_die(
    os.environ["QUEX_PATH"] + Setup.language_db["$code_base"] + Setup.language_db["$token-default-file"]
)
quex_file_parser.parse_section(fh)
fh.close()

BeginOfLineSupportF = True
IndentationSupportF = False

txt = write_configuration_header({}, IndentationSupportF, BeginOfLineSupportF)

open("TestAnalyzer-configuration", "w").write(txt)
import os
import sys

sys.path.insert(0, os.environ["QUEX_PATH"])

from quex.output.cpp.core import write_configuration_header
from quex.input.setup import setup as Setup
import quex.input.setup_parser as setup_parser
from quex.frs_py.file_in import open_file_or_die
import quex.input.quex_file_parser as quex_file_parser

setup_parser.do([
    "-i", "nothing", "-o", "TestAnalyzer", "--token-policy", "single",
    "--no-include-stack"
])

# Parse default token file
fh = open_file_or_die(os.environ["QUEX_PATH"] +
                      Setup.language_db["$code_base"] +
                      Setup.language_db["$token-default-file"])
quex_file_parser.parse_section(fh)
fh.close()

BeginOfLineSupportF = True
IndentationSupportF = False

txt = write_configuration_header({}, IndentationSupportF, BeginOfLineSupportF)

open("TestAnalyzer-configuration", "w").write(txt)
Пример #3
0
# This script needs to be located one directory above 'quex.'
# so that it ca get the imports straight.
from   quex.input.setup        import setup as Setup
import quex.input.setup_parser as setup_parser
import quex.input.query        as query_parser
import quex.core               as core

from quex.frs_py.file_in  import error_msg

if __name__ == "__main__":
    try:
        # (*) Call only for query? ___________________________________________________________
        if query_parser.do(sys.argv):   # if quex has been called for UCS property
            sys.exit(0)                 # query, then no further processing is performed

        # (*) Get Setup from Command Line and Config File ____________________________________
        setup_parser.do(sys.argv)

        if Setup.plot_graphic_format_list_f:
            print quex.output.graphviz.interface.get_supported_graphic_format_description()
            sys.exit(0)

        # (*) Run the Quex ___________________________________________________________________
        if Setup.plot_graphic_format == "": core.do()       # 'normal' code generation
        else:                               core.do_plot()  # plot transition graphs

    except "": # AssertionError:
        error_msg("Assertion error -- please report a bug at http://quex.sourceforge.net.")


Пример #4
0
from quex.input.setup import setup as Setup
import quex.input.setup_parser as setup_parser
import quex.input.query as query_parser
import quex.core as core

from quex.frs_py.file_in import error_msg

if __name__ == "__main__":
    try:
        # (*) Call only for query? ___________________________________________________________
        if query_parser.do(
                sys.argv):  # if quex has been called for UCS property
            sys.exit(0)  # query, then no further processing is performed

        # (*) Get Setup from Command Line and Config File ____________________________________
        setup_parser.do(sys.argv)

        if Setup.plot_graphic_format_list_f:
            print quex.output.graphviz.interface.get_supported_graphic_format_description(
            )
            sys.exit(0)

        # (*) Run the Quex ___________________________________________________________________
        if Setup.plot_graphic_format == "":
            core.do()  # 'normal' code generation
        else:
            core.do_plot()  # plot transition graphs

    except "":  # AssertionError:
        error_msg(
            "Assertion error -- please report a bug at http://quex.sourceforge.net."