def test_transform_equation_def():
    with open('./test/gams/equation-basic.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
        model = gp.transform()

        print("\nModel\n")
        print(model)
        print("\nSymbols:\n")
        for s in model.symbol():
            print(s)
Example #2
0
def test_variable_basic():
    with open('./test/gams/variable-basic.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
def test_scalar_basic():
    with open('./test/gams/scalar-basic.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
Example #4
0
def test_parameter_tuple():
    with open('./test/gams/parameter-tuple.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
def test_assignment_basic():
    with open('./test/gams/assignment-basic.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
Example #6
0
def test_misc_comments():
    with open('./test/gams/misc-comments.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
Example #7
0
def test_misc_include():
    with open('./test/gams/misc-include.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
Example #8
0
def test_open_file():
    gp = GamsParser('./test/gams/set-ranged.gms')
    parse_tree = gp.parse()
    print(parse_tree.pretty())
Example #9
0
def test_real_siteanalysis():
    with open('./test/gams/real-siteanalysis.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
Example #10
0
def test_real_shopmodel():
    with open('./test/gams/real-shopmodel.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
Example #11
0
def test_real_eminit():
    with open('./test/gams/real-eminit.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
Example #12
0
def test_set_multi():
    with open('./test/gams/set-multi.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
def test_equation_basic():
    with open('./test/gams/equation-basic.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
def test_equation_elementindex():
    with open('./test/gams/equation-elementindex.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())
def test_equation_indexoperator():
    with open('./test/gams/equation-indexoperator.gms', 'r') as in_file:
        gp = GamsParser(in_file)
        parse_tree = gp.parse()
        print(parse_tree.pretty())