Skip to content

Commit

Permalink
Merge branch 'ci'
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpas committed Apr 24, 2019
2 parents 8d938ce + 167514f commit f658b9c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
22 changes: 9 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 9 additions & 9 deletions dmc/src/Scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit f658b9c

Please sign in to comment.