Skip to content

Commit 4150532

Browse files
committed
Added scanner.re
1 parent 19a17a0 commit 4150532

File tree

4 files changed

+997
-4
lines changed

4 files changed

+997
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
# https://help.github.com/articles/ignoring-files/#create-a-global-gitignore
77

88
parser/lemon
9+
parser/scanner.c

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ On a Unix-based platform you can easily compile and install the extension from s
1212

1313
Prerequisite packages are:
1414

15-
* GCC compiler (Linux/Solaris/FreeBSD) or Xcode (MacOS)
15+
* GCC/Clang compiler (Linux/Solaris/FreeBSD) or Xcode (MacOS)
1616
* [`re2c`](http://re2c.org/) >= 0.13
1717

1818
## License

parser/build-linux

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/usr/bin/env bash
22

33
CC=${CC:-}
4-
GCC_BIN=${GCC_BIN:-$(which gcc 2>/dev/null)}
5-
CLANG_BIN=${CLANG_BIN:-$(which clang 2>/dev/null)}
4+
5+
GCC_BIN=${GCC_BIN:-$(command -v gcc 2>/dev/null)}
6+
CLANG_BIN=${CLANG_BIN:-$(command -v clang 2>/dev/null)}
7+
8+
RE2C_BIN=${RE2C_BIN:-$(command -v re2c 2>/dev/null)}
69

710
if [ x"$CC" != x ]; then
811
if [ x"$GCC_BIN" != x ]; then
@@ -15,10 +18,17 @@ if [ x"$CC" != x ]; then
1518
fi
1619

1720
if [ x"$CC" = x ]; then
18-
echo -e "Unable to locate the compiler"
21+
echo -e "error: unable to locate the compiler"
1922
exit 1
2023
fi
2124

25+
if [ x"$RE2C_BIN" = x ]; then
26+
echo -e "error: unable to locate the re2c"
27+
exit 2
28+
fi
29+
30+
${RE2C_BIN} -o scanner.c scanner.re
31+
2232
rm -f *.o *.lo
2333

2434
# Compile lemon

0 commit comments

Comments
 (0)