diff --git a/.travis.yml b/.travis.yml index 94c9357..076ea49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,31 +3,27 @@ branches: - master - ci # CI testing -language: cpp -cache: - apt: true +language: generic # Avoid system resetting CC/CXX before install +dist: xenial addons: apt: sources: - ubuntu-toolchain-r-test packages: - - g++-8 - env: COMPILER=gcc-8 COMPILERXX=g++-8 + - g++-8 # Install newer libstdc++ also required by clang matrix: include: - - compiler: gcc - env: COMPILER=gcc-8 COMPILERXX=g++-8 + - compiler: gcc-8 + env: CC=gcc-8 CXX=g++-8 -install: - # Overwrite compiler variables - - if [[ "${COMPILER}" != "" ]]; then - export CC=${COMPILER}; - export CXX=${COMPILERXX}; - fi + - compiler: clang + env: CC=clang CXX=clang++ script: + # DMC - cd dmc && mkdir build && cd build && cmake .. && make -j3 + # DME #- cd dme && mkdir build && cd build && cmake .. && make -j3 diff --git a/dmc/src/Scanner.h b/dmc/src/Scanner.h index e769f56..74f45dc 100644 --- a/dmc/src/Scanner.h +++ b/dmc/src/Scanner.h @@ -68,16 +68,16 @@ class Scanner { automata[0][i] = automata[1][i] = automata[2][i] = 1; } // In state 1, next is dot, go to state 2 - automata[1]['.'] = 2; + automata[1][(uint8_t)'.'] = 2; /* Operator */ // In state 0, next is '+', '*', '-', '/', '^' or '%', go to state 3 - automata[0]['+'] = automata[0]['*'] = automata[0]['-'] = - automata[0]['/'] = automata[0]['^'] = automata[0]['%'] = 3; + automata[0][(uint8_t)'+'] = automata[0][(uint8_t)'*'] = automata[0][(uint8_t)'-'] = + automata[0][(uint8_t)'/'] = automata[0][(uint8_t)'^'] = automata[0][(uint8_t)'%'] = 3; /* Separator */ // In state 0, next is '(', ')' or ';', go to state 4 - automata[0]['('] = automata[0][')'] = automata[0][';'] = 4; + automata[0][(uint8_t)'('] = automata[0][(uint8_t)')'] = automata[0][(uint8_t)';'] = 4; /* Identifier */ // In state 0 or 6, next is alphanumeric, go to state 6 @@ -91,14 +91,14 @@ class Scanner { for (int i = '0'; i <= '9'; i++) { automata[6][i] = 6; } - automata[6]['-'] = automata[6]['_'] = automata[6][':'] = 6; + automata[6][(uint8_t)'-'] = automata[6][(uint8_t)'_'] = automata[6][(uint8_t)':'] = 6; /* Ignore */ // In state 0 or 5, next is white-space, go to state 5 - automata[0]['\n'] = automata[5]['\n'] = - automata[0][' '] = automata[5][' '] = - automata[0]['\t'] = automata[5]['\t'] = - automata[0]['\r'] = automata[5]['\r'] = 5; + automata[0][(uint8_t)'\n'] = automata[5][(uint8_t)'\n'] = + automata[0][(uint8_t)' '] = automata[5][(uint8_t)' '] = + automata[0][(uint8_t)'\t'] = automata[5][(uint8_t)'\t'] = + automata[0][(uint8_t)'\r'] = automata[5][(uint8_t)'\r'] = 5; // State 0 not finite, returns lexical error finite[0] = Token::LexError;