Parser typename hinzugefügt

This commit is contained in:
JanUlrich 2014-08-07 12:11:18 +02:00
parent 25195440f0
commit 92408cfdcc
4 changed files with 951 additions and 820 deletions

2
TODO.md Normal file
View File

@ -0,0 +1,2 @@
Nächste Aufgaben:

View File

@ -226,6 +226,7 @@ public Vector<Pair> testPair = new Vector<Pair>();
%type <DeclId> variabledeclarator
%type <DeclId> variabledeclaratorid
%type <UsedId> simplename
%type <UsedId> typename
%type <UsedId> qualifiedname
%type <UsedId> importqualifiedname
%type <UsedId> importdeclaration
@ -786,6 +787,19 @@ classbodydeclaration : classmemberdeclaration
$$=$1;
}
//*/
typename : simplename
{
$$=$1;
}
| IDENTIFIER '.' typename
{
UsedId UI = new UsedId($1.getOffset());
UI.set_Name( $1.getLexem() + "." + $3 );
UI.setOffset($1.getOffset());//hinzugef�gt hoth: 07.04.2006
$$ = UI;
}
classorinterfacetype : simplename parameter
{
if ($2 != null) {
@ -1240,6 +1254,12 @@ type : primitivetype
{
$$=$1;
}
/*
| referencelongtype
{
$$=$1;
}
*/
|referencetype '[' ']'
{
$1.setArray(true);
@ -1357,6 +1377,28 @@ primitivetype :BOOLEAN
$$=$1;
}
referencelongtype : typename parameter
{
if ($2 != null) {
//$1.set_ParaList($2.get_ParaList());
$1.set_ParaList($2);//Änderung von Andreas Stadelmeier. Type statt GenericVarType
/* otth: originale (also diese) Parameterliste retten */
//((UsedId)$1).vParaOrg = new Vector<Type>( $2.get_ParaList() );
}
UsedId uid = $1;
RefType RT = new RefType(uid.getOffset());
RT.set_ParaList(uid.get_RealParaList());
RT.setName(uid.getQualifiedName());
//PL 05-07-30 eingefuegt containedTypes ANFANG
containedTypes.addElement(RT);
//PL 05-07-30 eingefuegt containedTypes ENDE
$$=RT;
}
referencetype :classorinterfacetype
{
org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + $1);
@ -1375,6 +1417,8 @@ referencetype :classorinterfacetype
$$=RT;
}
/* 05-07-28 PL Parameterdeklarationen zur classorinterfacetype verschoben */
variabledeclarator : variabledeclaratorid

File diff suppressed because it is too large Load Diff

View File

@ -226,6 +226,7 @@ public Vector<Pair> testPair = new Vector<Pair>();
%type <DeclId> variabledeclarator
%type <DeclId> variabledeclaratorid
%type <UsedId> simplename
%type <UsedId> typename
%type <UsedId> qualifiedname
%type <UsedId> importqualifiedname
%type <UsedId> importdeclaration
@ -786,6 +787,19 @@ classbodydeclaration : classmemberdeclaration
$$=$1;
}
//*/
typename : simplename
{
$$=$1;
}
| IDENTIFIER '.' typename
{
UsedId UI = new UsedId($1.getOffset());
UI.set_Name( $1.getLexem() + "." + $3 );
UI.setOffset($1.getOffset());//hinzugef�gt hoth: 07.04.2006
$$ = UI;
}
classorinterfacetype : simplename parameter
{
if ($2 != null) {
@ -1240,6 +1254,12 @@ type : primitivetype
{
$$=$1;
}
/*
| referencelongtype
{
$$=$1;
}
*/
|referencetype '[' ']'
{
$1.setArray(true);
@ -1357,6 +1377,28 @@ primitivetype :BOOLEAN
$$=$1;
}
referencelongtype : typename parameter
{
if ($2 != null) {
//$1.set_ParaList($2.get_ParaList());
$1.set_ParaList($2);//Änderung von Andreas Stadelmeier. Type statt GenericVarType
/* otth: originale (also diese) Parameterliste retten */
//((UsedId)$1).vParaOrg = new Vector<Type>( $2.get_ParaList() );
}
UsedId uid = $1;
RefType RT = new RefType(uid.getOffset());
RT.set_ParaList(uid.get_RealParaList());
RT.setName(uid.getQualifiedName());
//PL 05-07-30 eingefuegt containedTypes ANFANG
containedTypes.addElement(RT);
//PL 05-07-30 eingefuegt containedTypes ENDE
$$=RT;
}
referencetype :classorinterfacetype
{
org.apache.log4j.Logger.getLogger("parser").debug("T->Parser->referenctype: " + $1);
@ -1375,6 +1417,8 @@ referencetype :classorinterfacetype
$$=RT;
}
/* 05-07-28 PL Parameterdeklarationen zur classorinterfacetype verschoben */
variabledeclarator : variabledeclaratorid