Ejemplo n.º 1
0
def main(argv):
    if len(argv) < 2:
        print 'usage: pft.py <master> [@]<format> [-mfn=<startMfn>] [-count=<num>]'
        sys.exit()

    config = initialize()
    # Adjust parser options
    from pyisis.session import initialize as init_session
    import tempfile
    config.YACC_DEBUG = False
    config.PARSER_AUXFILES_DIR = tempfile.gettempdir()
    init_session(config)

    dbname = join("..", "sample", argv[0])
    mfn = 1
    count = 1

    for param in argv:
        if param.startswith("-mfn="):
            mfn = int(param[5:])
        if param.startswith("-count="):
            count = int(param[7:])
    compFmt(dbname, argv[1], mfn, count)
Ejemplo n.º 2
0
File to test Formatting Language Parser
"""

__created__ = "2008-05-27"
__updated__ = "2008-05-26"
__author__ = "Rodrigo Senra <*****@*****.**>"

import tempfile
from pyisis.records import MasterRecord
from pyisis.lexer import PftLexer
from pyisis.parser import PftParser
from pyisis.ast import *

from pyisis.tests.config_tests import test_data, Lyer, initialize, run_list

config = initialize()

tmpdir = tempfile.gettempdir()
lexer = PftLexer()
parser = PftParser(lexer=lexer.lexer, debug=False, outputdir=tmpdir)
compiler = PftCompiler()


def setup():
    "Fixture: Called before every test to reset the lexer"
    pass


def test_empty():
    """Parse empty expression"""
    try: