Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
latte
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zygzagZ
latte
Commits
e83a94b3
Commit
e83a94b3
authored
Dec 08, 2020
by
zygzagZ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Info
parent
8072a075
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
Info.cpp
Info.cpp
+2
-0
Info.h
Info.h
+11
-3
Makefile
Makefile
+4
-1
No files found.
Info.cpp
View file @
e83a94b3
#include "Info.h"
Scope
g_scope
;
Info.h
View file @
e83a94b3
#ifndef INFO_HEADER
#ifndef INFO_HEADER
#define INFO_HEADER
#define INFO_HEADER
#include "Absyn.h"
#include "Absyn.h"
using
namespace
std
;
using
namespace
std
;
...
@@ -10,7 +11,7 @@ class VarInfo {
...
@@ -10,7 +11,7 @@ class VarInfo {
bool
operator
<
(
const
VarInfo
&
other
)
const
{
bool
operator
<
(
const
VarInfo
&
other
)
const
{
return
name
!=
other
.
name
?
name
<
other
.
name
:
type
<
other
.
type
;
return
name
!=
other
.
name
?
name
<
other
.
name
:
type
<
other
.
type
;
}
}
}
}
;
class
FunctionInfo
:
VarInfo
{
class
FunctionInfo
:
VarInfo
{
vector
<
VarInfo
>
arguments
;
vector
<
VarInfo
>
arguments
;
...
@@ -26,5 +27,12 @@ public:
...
@@ -26,5 +27,12 @@ public:
};
};
vector
<
ClassInfo
>
classes
;
vector
<
FunctionInfo
>
functions
;
class
Scope
{
public:
vector
<
ClassInfo
>
classes
;
vector
<
FunctionInfo
>
functions
;
};
extern
Scope
g_scope
;
#endif
\ No newline at end of file
Makefile
View file @
e83a94b3
...
@@ -7,7 +7,7 @@ FLEX_OPTS=-PGrammar
...
@@ -7,7 +7,7 @@ FLEX_OPTS=-PGrammar
BISON
=
bison
BISON
=
bison
BISON_OPTS
=
-t
-pGrammar
BISON_OPTS
=
-t
-pGrammar
OBJS
=
Absyn.o Lexer.o Parser.o Printer.o TypeCheck.o
OBJS
=
Absyn.o Lexer.o Parser.o Printer.o TypeCheck.o
Info.o
.PHONY
:
clean distclean
.PHONY
:
clean distclean
...
@@ -49,3 +49,6 @@ Latte.o : Latte.cpp Parser.h Printer.h Absyn.h ParseError.h
...
@@ -49,3 +49,6 @@ Latte.o : Latte.cpp Parser.h Printer.h Absyn.h ParseError.h
TypeCheck.o
:
TypeCheck.cpp TypeCheck.h Absyn.h ParseError.h
TypeCheck.o
:
TypeCheck.cpp TypeCheck.h Absyn.h ParseError.h
${
CC
}
${
CCFLAGS
}
-c
TypeCheck.cpp
${
CC
}
${
CCFLAGS
}
-c
TypeCheck.cpp
Info.o
:
Info.cpp Info.h Absyn.h
${
CC
}
${
CCFLAGS
}
-c
Info.cpp
Write
Preview
Markdown
is supported
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