Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Compiler_hw3_interpreter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lang0909
Compiler_hw3_interpreter
Commits
35adafca
Commit
35adafca
authored
5 years ago
by
lang0909
Browse files
Options
Downloads
Patches
Plain Diff
Add header file
parent
988213ce
No related branches found
No related tags found
No related merge requests found
Pipeline
#2138
canceled
5 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
inter.h
+42
-0
42 additions, 0 deletions
inter.h
with
42 additions
and
0 deletions
inter.h
0 → 100644
+
42
−
0
View file @
35adafca
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
typedef
enum
{
typeId
,
typeCon
,
typeReal
,
typeOpr
}
typeEnum
;
typedef
struct
{
char
str
[
20
];
int
index
;
}
nodeId
;
typedef
struct
{
int
conValue
;
}
nodeCon
;
typedef
struct
{
double
realValue
;
}
nodeReal
;
typedef
struct
{
int
optn
;
struct
nodeType
*
list
[
2
];
}
nodeOpr
;
typedef
struct
nodeType
{
typeEnum
type
;
union
{
nodeId
id
;
nodeCon
con
;
nodeReal
real
;
nodeOpr
opr
;
};
}
Node
;
typedef
struct
{
char
symbol
[
20
];
double
rv
;
}
SYMBOL_TABLE
;
extern
SYMBOL_TABLE
symbol_table
[
20
];
extern
int
symbol_index
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment