Skip to content

Commit 82344a5

Browse files
committed
add multiple declaration error detection
1 parent b201bb8 commit 82344a5

File tree

8 files changed

+140
-43
lines changed

8 files changed

+140
-43
lines changed

‎.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"files.associations": {
3+
"*.lex": "lex",
4+
"syntactical_analyzer.h": "c"
5+
}
6+
}

‎compile.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
# How to use ?
99
# 1. Make sure the script has execution permission (+x)
1010
# 2. run the following command:
11-
# ./compile.sh <my_flex_file.lex> <my_syntactic_analyzer_file.c> <my_executable_file_name>
11+
# ./compile.sh <my_flex_file.lex> <my_syntactic_analyzer_file.c> <my_tab_symbol_file.c> <my_executable_file_name>
1212

1313
flex "$1"
1414
gcc -c lex.yy.c
1515
gcc -c "$2"
16+
gcc -c "$3"
1617
file_name1=$(echo "$2" | cut -d '.' -f 1)
17-
#file_name2=$(echo "$3" | cut -d '.' -f 1)
18+
file_name2=$(echo "$3" | cut -d '.' -f 1)
1819
#file_name3=$(echo "$4" | cut -d '.' -f 1)
19-
gcc -o "$3" lex.yy.o "$file_name1.o"
20+
gcc -o "$4" lex.yy.o "$file_name1.o" "$file_name2.o"
2021
rm lex.yy.c *.o

‎main

632 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)