Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CompilerConstruction
CodeSamples
Commits
411d0123
Commit
411d0123
authored
May 01, 2020
by
Ronald Charles Moore
Browse files
Improved CFLAGS in the Compiler, and fixed the warnings this brought to light
parent
b8b7fdf2
Changes
2
Show whitespace changes
Inline
Side-by-side
recursiveDescentParsers/cplusplus/interpreter/Makefile
View file @
411d0123
...
@@ -12,7 +12,7 @@ TESTFILES := testInput.txt testOutput.txt
...
@@ -12,7 +12,7 @@ TESTFILES := testInput.txt testOutput.txt
CC
:=
clang++
CC
:=
clang++
## Add your own CFLAGS if you find them necessary... such as -O3 or so...
## Add your own CFLAGS if you find them necessary... such as -O3 or so...
CFLAGS
:=
CFLAGS
:=
-g
-std
=
c++17
-Wall
## More preliminaries
## More preliminaries
...
...
recursiveDescentParsers/cplusplus/interpreter/interpreter.cpp
View file @
411d0123
...
@@ -43,7 +43,6 @@ static std::istream *input = &(std::cin); // until proven otherwise
...
@@ -43,7 +43,6 @@ static std::istream *input = &(std::cin); // until proven otherwise
static
std
::
string
currentLine
(
""
);
static
std
::
string
currentLine
(
""
);
static
int
currentLineNumber
=
-
1
;
static
int
currentLineNumber
=
-
1
;
static
int
currentColumnNumber
=
0
;
static
int
currentColumnNumber
=
0
;
static
int
currentTokenLength
=
0
;
static
Token
next_token
;
// again with the global variables...
static
Token
next_token
;
// again with the global variables...
static
numberType
currentNumber
;
// = zero....
static
numberType
currentNumber
;
// = zero....
...
@@ -165,7 +164,7 @@ numberType E2ndHalf() {
...
@@ -165,7 +164,7 @@ numberType E2ndHalf() {
// T´ → * F T´ | / F T´ | ε
// T´ → * F T´ | / F T´ | ε
numberType
T2ndHalf
()
{
numberType
T2ndHalf
()
{
numberType
tmp
,
rhs
,
acc
;
numberType
tmp
;
// Compiler forces me to put this here :-(
switch
(
next_token
)
{
switch
(
next_token
)
{
case
tok_times
:
case
tok_times
:
next_token
=
gettok
();
// eat *
next_token
=
gettok
();
// eat *
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment