Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
2024_compilation_Bazizi_Zaynoune
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
BAZIZI Zakaria
2024_compilation_Bazizi_Zaynoune
Commits
fc9753d6
Commit
fc9753d6
authored
1 year ago
by
ZaynouneFatimaZahrae
Browse files
Options
Downloads
Patches
Plain Diff
testing again
parent
8cf159de
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sa/Sc2sa.java
+47
-101
47 additions, 101 deletions
src/sa/Sc2sa.java
with
47 additions
and
101 deletions
src/sa/Sc2sa.java
+
47
−
101
View file @
fc9753d6
...
...
@@ -979,16 +979,14 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public
void
caseADeclavariableDecvar
(
ADeclavariableDecvar
node
)
{
inADeclavariableDecvar
(
node
)
;
if
(
node
.
getType
()
!=
null
)
{
//decvar = {declavariable} type id |type id crochetg nombre crochetd
;
Type
type
=
null
;
node
.
getType
().
apply
(
this
);
}
if
(
node
.
getId
()
!=
null
)
{
node
.
getId
().
apply
(
this
);
}
outADeclavariableDecvar
(
node
);
type
=
this
.
returnType
;
returnValue
=
new
SaDecVarSimple
(
node
.
getId
().
getText
(),
type
);
}
public
void
inADecvar
(
ADecvar
node
)
...
...
@@ -1004,28 +1002,12 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public
void
caseADecvar
(
ADecvar
node
)
{
inAD
ecvar
(
node
)
;
if
(
node
.
getType
()
!=
null
)
{
//d
ecvar
= {declavariable} type id |type id crochetg nombre crochetd
;
Type
type
=
null
;
node
.
getType
().
apply
(
this
);
}
if
(
node
.
getId
()
!=
null
)
{
node
.
getId
().
apply
(
this
);
}
if
(
node
.
getCrochetg
()
!=
null
)
{
node
.
getCrochetg
().
apply
(
this
);
}
if
(
node
.
getNombre
()
!=
null
)
{
node
.
getNombre
().
apply
(
this
);
}
if
(
node
.
getCrochetd
()
!=
null
)
{
node
.
getCrochetd
().
apply
(
this
);
}
outADecvar
(
node
);
type
=
this
.
returnType
;
returnValue
=
new
SaDecTab
(
node
.
getId
().
getText
(),
type
,
Integer
.
parseInt
(
node
.
getNombre
().
getText
()));
}
public
void
inATypeType
(
ATypeType
node
)
...
...
@@ -1081,36 +1063,7 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public
void
caseADeclafoncDecfonc
(
ADeclafoncDecfonc
node
)
{
inADeclafoncDecfonc
(
node
);
if
(
node
.
getTypeopt
()
!=
null
)
{
node
.
getTypeopt
().
apply
(
this
);
}
if
(
node
.
getId
()
!=
null
)
{
node
.
getId
().
apply
(
this
);
}
if
(
node
.
getGparenthese
()
!=
null
)
{
node
.
getGparenthese
().
apply
(
this
);
}
if
(
node
.
getFirstldec
()
!=
null
)
{
node
.
getFirstldec
().
apply
(
this
);
}
if
(
node
.
getDparenthese
()
!=
null
)
{
node
.
getDparenthese
().
apply
(
this
);
}
if
(
node
.
getSecondldec
()
!=
null
)
{
node
.
getSecondldec
().
apply
(
this
);
}
if
(
node
.
getBloc
()
!=
null
)
{
node
.
getBloc
().
apply
(
this
);
}
outADeclafoncDecfonc
(
node
);
new
SaDecFonc
()
}
public
void
inATypeoptTypeopt
(
ATypeoptTypeopt
node
)
...
...
@@ -1127,10 +1080,7 @@ public class Sc2sa extends DepthFirstAdapter
public
void
caseATypeoptTypeopt
(
ATypeoptTypeopt
node
)
{
inATypeoptTypeopt
(
node
);
if
(
node
.
getType
()
!=
null
)
{
node
.
getType
().
apply
(
this
);
}
outATypeoptTypeopt
(
node
);
}
...
...
@@ -1168,16 +1118,16 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public
void
caseALstdeclacvarLdec
(
ALstdeclacvarLdec
node
)
{
inALstdeclacvarLdec
(
node
);
if
(
node
.
getDecvar
()
!=
null
)
{
//ldec = {lstdeclacvar} decvar suitedec | epsilon ;
SaDecVar
op1
=
null
;
SaLDecVar
op2
=
null
;
node
.
getDecvar
().
apply
(
this
);
}
if
(
node
.
getSuitedec
()
!=
null
)
{
op1
=
(
SaDecVar
)
this
.
returnValue
;
node
.
getSuitedec
().
apply
(
this
);
}
outALstdeclacvarLdec
(
node
);
op2
=
(
SaLDecVar
)
this
.
returnValue
;
returnValue
=
new
SaLDecVar
(
op1
,
op2
);
}
public
void
inALdec
(
ALdec
node
)
...
...
@@ -1214,20 +1164,17 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public
void
caseASuitedeclvarSuitedec
(
ASuitedeclvarSuitedec
node
)
{
inASuitedeclvarSuitedec
(
node
);
if
(
node
.
getVirgule
()
!=
null
)
{
node
.
getVirgule
().
apply
(
this
);
}
if
(
node
.
getDecvar
()
!=
null
)
{
//suitedec = {suitedeclvar} virgule decvar suitedec |epsilon ;
//ldec = {lstdeclacvar} decvar suitedec | epsilon ;
SaDecVar
op1
=
null
;
SaLDecVar
op2
=
null
;
//node.getVirgule().apply(this);
node
.
getDecvar
().
apply
(
this
);
}
if
(
node
.
getSuitedec
()
!=
null
)
{
op1
=
(
SaDecVar
)
this
.
returnValue
;
node
.
getSuitedec
().
apply
(
this
);
}
outASuitedeclvarSuitedec
(
node
);
op2
=
(
SaLDecVar
)
this
.
returnValue
;
returnValue
=
new
SaLDecVar
(
op1
,
op2
);
}
public
void
inASuitedec
(
ASuitedec
node
)
...
...
@@ -1263,17 +1210,16 @@ public class Sc2sa extends DepthFirstAdapter
@Override
public
void
caseALstdecfncLdf
(
ALstdecfncLdf
node
)
{
inALstdecfncLdf
(
node
);
if
(
node
.
getDecfonc
()
!=
null
)
{
{;
//ldf = {lstdecfnc} decfonc ldf | epsilon
SaDecFonc
op1
=
null
;
SaLDecFonc
op2
=
null
;
node
.
getDecfonc
().
apply
(
this
);
}
if
(
node
.
getLdf
()
!=
null
)
{
op1
=
(
SaDecFonc
)
this
.
returnValue
;
node
.
getLdf
().
apply
(
this
);
}
outALstdecfncLdf
(
node
);
op2
=
(
SaLDecFonc
)
this
.
returnValue
;
returnValue
=
new
SaLDecFonc
(
op1
,
op2
);
}
public
void
inALdf
(
ALdf
node
)
...
...
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