modifications interpreter
This commit is contained in:
parent
0fa10f44a9
commit
7734aea2d2
6 changed files with 42 additions and 2 deletions
8
Interpreteur/src/.idea/.gitignore
vendored
Normal file
8
Interpreteur/src/.idea/.gitignore
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
8
Interpreteur/src/.idea/modules.xml
Normal file
8
Interpreteur/src/.idea/modules.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/src.iml" filepath="$PROJECT_DIR$/.idea/src.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
8
Interpreteur/src/.idea/src.iml
Normal file
8
Interpreteur/src/.idea/src.iml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="CPP_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
6
Interpreteur/src/.idea/vcs.xml
Normal file
6
Interpreteur/src/.idea/vcs.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -66,6 +66,9 @@ void asm_add_2(char ins, int arg1, int arg2) {
|
||||||
void asm_add_1(char ins, int arg1) {
|
void asm_add_1(char ins, int arg1) {
|
||||||
asm_add_3(ins, arg1, 0, 0);
|
asm_add_3(ins, arg1, 0, 0);
|
||||||
}
|
}
|
||||||
|
void asm_add_0(char ins) {
|
||||||
|
asm_add_3(ins, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
void asm_run() {
|
void asm_run() {
|
||||||
int ip = 0;
|
int ip = 0;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
int nb;
|
int nb;
|
||||||
}
|
}
|
||||||
|
|
||||||
%token tADD tMUL tSOU tDIV tCOP tAFC tJMP tJMF tINF tSUP tEQU tPRI tAFCA tWR tREAD
|
%token tADD tMUL tSOU tDIV tCOP tAFC tJMP tJMF tINF tSUP tEQU tPRI tAFCA tWR tREAD tCOPR tCALL tRET
|
||||||
|
|
||||||
%token <nb> tNB
|
%token <nb> tNB
|
||||||
|
|
||||||
|
@ -59,6 +59,13 @@ Instruction:
|
||||||
{asm_add_2(WR, $2, $3);}
|
{asm_add_2(WR, $2, $3);}
|
||||||
| tREAD tNB tNB
|
| tREAD tNB tNB
|
||||||
{asm_add_2(READ, $2, $3);}
|
{asm_add_2(READ, $2, $3);}
|
||||||
|
| tCOPR tNB tNB
|
||||||
|
{asm_add_2(COPR, $2, $3);}
|
||||||
|
| tCALL tNB tNB tNB
|
||||||
|
{asm_add_3(READ, $2, $3, $4);}
|
||||||
|
| tRET
|
||||||
|
{asm_add_0(RET);}
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue