Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
2024_compilation_bauquin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BAUQUIN Niels
2024_compilation_bauquin
Commits
995f4b05
Commit
995f4b05
authored
1 year ago
by
BAUQUIN Niels
Browse files
Options
Downloads
Patches
Plain Diff
geg
parent
59cd6dbd
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Compiler.java
+2
-2
2 additions, 2 deletions
src/Compiler.java
src/nasm/C3a2nasm.java
+85
-11
85 additions, 11 deletions
src/nasm/C3a2nasm.java
with
87 additions
and
13 deletions
src/Compiler.java
+
2
−
2
View file @
995f4b05
...
@@ -41,10 +41,10 @@ public class Compiler
...
@@ -41,10 +41,10 @@ public class Compiler
System
.
out
.
println
(
"[BUILD C3A] "
);
System
.
out
.
println
(
"[BUILD C3A] "
);
buildC3a
();
buildC3a
();
/*
System
.
out
.
println
(
"[BUILD PRE NASM] "
);
System
.
out
.
println
(
"[BUILD PRE NASM] "
);
buildPreNasm
();
buildPreNasm
();
System.out.println("[BUILD FLOW GRAPH] ");
/*
System.out.println("[BUILD FLOW GRAPH] ");
buildFg();
buildFg();
System.out.println("[SOLVE FLOW GRAPH]");
System.out.println("[SOLVE FLOW GRAPH]");
solveFg();
solveFg();
...
...
This diff is collapsed.
Click to expand it.
src/nasm/C3a2nasm.java
+
85
−
11
View file @
995f4b05
...
@@ -29,30 +29,104 @@ public class C3a2nasm implements C3aVisitor <NasmOperand> {
...
@@ -29,30 +29,104 @@ public class C3a2nasm implements C3aVisitor <NasmOperand> {
public
Nasm
getNasm
(){
return
nasm
;}
public
Nasm
getNasm
(){
return
nasm
;}
public
NasmOperand
visit
(
C3a
c3a
){
return
null
;}
public
NasmOperand
visit
(
C3a
c3a
){
public
NasmOperand
visit
(
C3aInstAdd
inst
){
return
null
;}
c3a
.
affiche
(
"caca"
);
public
NasmOperand
visit
(
C3aInstCall
inst
){
return
null
;}
for
(
C3aInst
c3aInst
:
c3a
.
listeInst
)
{
public
NasmOperand
visit
(
C3aInstFBegin
inst
){
return
null
;}
c3aInst
.
accept
(
this
);
System
.
out
.
println
(
c3aInst
.
getClass
());
}
nasm
.
affichePreNasm
(
"caca"
);
return
null
;
}
public
NasmOperand
visit
(
C3aInstAdd
inst
){
NasmOperand
label
=
(
inst
.
label
!=
null
)
?
inst
.
label
.
accept
(
this
)
:
null
;
nasm
.
ajouteInst
(
new
NasmMov
(
label
,
inst
.
result
.
accept
(
this
),
inst
.
op1
.
accept
(
this
),
""
));
nasm
.
ajouteInst
(
new
NasmAdd
(
null
,
inst
.
result
.
accept
(
this
),
inst
.
op2
.
accept
(
this
),
""
));
return
null
;
}
public
NasmOperand
visit
(
C3aInstCall
inst
){
NasmOperand
address
=
(
inst
.
label
!=
null
)
?
inst
.
label
.
accept
(
this
)
:
null
;
nasm
.
ajouteInst
(
new
NasmCall
(
null
,
address
,
""
));
return
null
;
}
public
NasmOperand
visit
(
C3aInstFBegin
inst
){
return
null
;
}
public
NasmOperand
visit
(
C3aInst
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInst
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstJumpIfLess
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstJumpIfLess
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstMult
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstMult
inst
){
NasmOperand
label
=
(
inst
.
label
!=
null
)
?
inst
.
label
.
accept
(
this
)
:
null
;
nasm
.
ajouteInst
(
new
NasmMov
(
label
,
inst
.
result
.
accept
(
this
),
inst
.
op1
.
accept
(
this
),
""
));
nasm
.
ajouteInst
(
new
NasmMul
(
null
,
inst
.
result
.
accept
(
this
),
inst
.
op2
.
accept
(
this
),
""
));
return
null
;
}
public
NasmOperand
visit
(
C3aInstRead
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstRead
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstSub
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstSub
inst
){
NasmOperand
label
=
(
inst
.
label
!=
null
)
?
inst
.
label
.
accept
(
this
)
:
null
;
nasm
.
ajouteInst
(
new
NasmMov
(
label
,
inst
.
result
.
accept
(
this
),
inst
.
op1
.
accept
(
this
),
""
));
nasm
.
ajouteInst
(
new
NasmSub
(
null
,
inst
.
result
.
accept
(
this
),
inst
.
op2
.
accept
(
this
),
""
));
return
null
;
}
public
NasmOperand
visit
(
C3aInstAffect
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstAffect
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstDiv
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstDiv
inst
){
public
NasmOperand
visit
(
C3aInstFEnd
inst
){
return
null
;}
NasmOperand
label
=
(
inst
.
label
!=
null
)
?
inst
.
label
.
accept
(
this
)
:
null
;
nasm
.
ajouteInst
(
new
NasmMov
(
label
,
inst
.
result
.
accept
(
this
),
inst
.
op1
.
accept
(
this
),
""
));
nasm
.
ajouteInst
(
new
NasmDiv
(
null
,
inst
.
result
.
accept
(
this
),
""
));
return
null
;
}
public
NasmOperand
visit
(
C3aInstFEnd
inst
){
return
null
;
}
public
NasmOperand
visit
(
C3aInstJumpIfEqual
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstJumpIfEqual
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstJumpIfNotEqual
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstJumpIfNotEqual
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstJump
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstJump
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstParam
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstParam
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstReturn
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstReturn
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstWrite
inst
){
return
null
;}
public
NasmOperand
visit
(
C3aInstWrite
inst
){
public
NasmOperand
visit
(
C3aInstStop
inst
){
return
null
;}
return
null
;
}
public
NasmOperand
visit
(
C3aInstStop
inst
){
return
null
;
}
public
NasmOperand
visit
(
C3aConstant
oper
){
return
null
;}
public
NasmOperand
visit
(
C3aConstant
oper
){
return
null
;}
public
NasmOperand
visit
(
C3aBooleanConstant
oper
){
return
null
;}
public
NasmOperand
visit
(
C3aBooleanConstant
oper
){
return
null
;}
public
NasmOperand
visit
(
C3aLabel
oper
){
return
null
;}
public
NasmOperand
visit
(
C3aLabel
oper
){
return
null
;}
public
NasmOperand
visit
(
C3aTemp
oper
){
return
null
;}
public
NasmOperand
visit
(
C3aTemp
oper
){
return
null
;
}
public
NasmOperand
visit
(
C3aVar
oper
){
return
null
;}
public
NasmOperand
visit
(
C3aVar
oper
){
return
null
;}
public
NasmOperand
visit
(
C3aFunction
oper
){
return
null
;}
public
NasmOperand
visit
(
C3aFunction
oper
){
return
null
;}
...
...
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