Skip to content

cxu2/Expressio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ian Treyball (Language Guru) ict2102
Lalka Rieger (Tester) ler2161
Chengtian Xu (System Architect) cx2168
David Han (Team Manager) dth2126

To build our toplevel (expresso.native):
$ cd src
$ make clean && make

To run our compiler (as it stands):
$ ./express.native <filename.xp>

To run tests:
$ ./testall.sh

4/18/2018
For this extended test-suite deliverable, we have 8 positive tests and 3 semantically negative
integration tests.

The 8 positive tests include:
  1. test-hello.xp
    - Test for printing a string. This test prints:

    Hello World!

  2. test-for1.xp
    - Test for using a "for" loop. This test loops an integer i from 0 to 4
    and prints:

    0
    1
    2
    3
    4

  3. test-while.xp
    - Test for using a while loop. Expressio does not have the while keyword
    but still uses the "for" keyword to offer while loops. This test uses
    integers a and b, and both are set to 1 and 4, respectively. The test uses
    a while loop with the condition that a < b, and the body of the loop
    increments a by 1. This test prints:

    1
    2
    3

  4. test-continue.xp
    - Test for using "continue" during a loop. This test uses a for loop to
    print from 0 to 4, but uses an if statement to check when the loop is at 3
    in which "continue" is used to skip the printing of 3. This test prints:

    0
    1
    2
    4

  5. test-function.xp
    - Test for using an outside function being called in the main function. This
    test calls a gcd function defined outside of main and finds and prints
    the gcd of 2 and 4. This test prints:

    2

  6. test-dfa.xp
    - Test for pretty printing a "dfa" type. In this test, a DFA is defined
    and it is passed to the "printdfa" function which pretty-prints all of
    the arguments of the dfa. This test prints:


    nstates:  7
    alphabet: 0 1 2 3 4 5
    nsym:     6
    start:    4
    fin:      5 2
    nfin:     2
    delta:
            |   0 |   1 |   2 |   3 |   4 |   5
        ----|-----|-----|-----|-----|-----|-----
           0|   4    -1    -1    -1    -1    -1
           1|   3    -1    -1    -1    -1    -1
           2|  -1    -1    -1    -1    -1    -1
           3|  -1    -1    -1    -1    -1    -1
           4|  -1    -1    -1    -1    -1    -1
           5|  -1    -1    -1    -1    -1    -1
           6|  -1    -1    -1    -1    -1    -1

    7. test-printr.xp
      - Test for printing a "regexp" type. In this test, several regular
      expressions are defined and combined to form a larger regular expression,
      which is passed to the "printr" function which prints the entire
      regular expression. This test prints:

      ( a & ( c | ( c ^ a ) ) ) *

    8. test-if1.xp
      - Testing an if statement. In this test, we start with an integer a = 1,
      and testing if a is greater than or equal to 0. If the test is true,
      it prints 42. This test prints:

      42

The 3 semantically negative integration tests include:
  1. fail-break.xp
    - Semantically checking for the "break" keyword and this test fails
    because "break" is used outside of a loop.

  2. fail-continue.xp
    - Semantically checking for the "continue" keyword and this test fails
    because "continue" is used outside of a loop.

  3. fail-dfa.xp
    - Semantically checking the arguments of the "dfa" type. This test fails
    because the DFA is invalid due to the transition table of the dfa not being
    a function.

About

Regular Language (Regular Expression/Finite State Machine) Language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •