|
@@ -42,7 +42,7 @@ ModuleInfo * CurModule=NULL;
|
|
|
ProcInfo * CurProc;
|
|
|
ParamInfo * CurParam;
|
|
|
LayoutInfo * CurLayout;
|
|
|
-EnumInfo * CurEnum=NULL;
|
|
|
+EnumInfo * CurEnum=NULL;
|
|
|
EnumValInfo * CurEnumVal;
|
|
|
int EnumValue = 0;
|
|
|
ApiInfo * CurApi=NULL;
|
|
@@ -57,7 +57,7 @@ ModuleInfo * LastModule;
|
|
|
ProcInfo * LastProc;
|
|
|
ParamInfo * LastParam;
|
|
|
LayoutInfo * LastLayout;
|
|
|
-EnumInfo * LastEnum;
|
|
|
+EnumInfo * LastEnum;
|
|
|
EnumValInfo * LastEnumVal;
|
|
|
ApiInfo * LastApi=NULL;
|
|
|
IncludeInfo *LastInclude=NULL;
|
|
@@ -143,7 +143,7 @@ SectionList
|
|
|
;
|
|
|
|
|
|
Section
|
|
|
- : Module
|
|
|
+ : Module
|
|
|
| Enumeration
|
|
|
| ExportDef
|
|
|
| EspDefExport
|
|
@@ -177,7 +177,7 @@ EspService
|
|
|
AddEspService();
|
|
|
//Now the default is sorted
|
|
|
if (CurService->getMetaInt("sort_method",1)!=0)
|
|
|
- CurService->sortMethods();
|
|
|
+ CurService->sortMethods();
|
|
|
CurService=NULL;
|
|
|
}
|
|
|
;
|
|
@@ -191,8 +191,8 @@ EspServiceStart
|
|
|
;
|
|
|
|
|
|
EspServiceBody
|
|
|
- : '{' EspServiceEntryList '}'
|
|
|
- | '{' '}'
|
|
|
+ : '{' EspServiceEntryList '}'
|
|
|
+ | '{' '}'
|
|
|
;
|
|
|
|
|
|
EspServiceEntryList
|
|
@@ -221,7 +221,7 @@ EspServiceMethod
|
|
|
CurEspMessage = new EspMessageInfo(EspMessageInfo::espm_request, CurProc);
|
|
|
AddEspMessage();
|
|
|
CurEspMessage=NULL;
|
|
|
-
|
|
|
+
|
|
|
CurEspMessage = new EspMessageInfo(EspMessageInfo::espm_response, CurProc);
|
|
|
AddEspMessage();
|
|
|
CurEspMessage=NULL;
|
|
@@ -238,7 +238,7 @@ EspServiceMethod
|
|
|
CurEspMessage = new EspMessageInfo(EspMessageInfo::espm_request, CurProc);
|
|
|
AddEspMessage();
|
|
|
CurEspMessage=NULL;
|
|
|
-
|
|
|
+
|
|
|
CurEspMessage = new EspMessageInfo(EspMessageInfo::espm_response, CurProc);
|
|
|
AddEspMessage();
|
|
|
CurEspMessage=NULL;
|
|
@@ -246,7 +246,7 @@ EspServiceMethod
|
|
|
EspMethodInfo *CurMethod=new EspMethodInfo(CurProc);
|
|
|
delete CurProc;
|
|
|
CurProc=NULL;
|
|
|
-
|
|
|
+
|
|
|
AddEspMethod();
|
|
|
CurMethod=NULL;
|
|
|
}
|
|
@@ -269,7 +269,7 @@ EspServiceUses
|
|
|
: ESPUSES EspMetaData EspType ID ';'
|
|
|
{
|
|
|
EspStructInfo *esp_struct=new EspStructInfo($4.getName());
|
|
|
-
|
|
|
+
|
|
|
esp_struct->tags = getClearCurMetaTags();
|
|
|
|
|
|
esp_struct->next=CurService->structs;
|
|
@@ -286,7 +286,7 @@ EspStruct
|
|
|
;
|
|
|
|
|
|
EspStructStart
|
|
|
- : ESPSTRUCT EspMetaData ID
|
|
|
+ : ESPSTRUCT EspMetaData ID
|
|
|
{
|
|
|
CurEspMessage = new EspMessageInfo($3.getName(), EspMessageInfo::espm_struct);
|
|
|
CurEspMessage->tags = getClearCurMetaTags();
|
|
@@ -305,7 +305,7 @@ EspEnum
|
|
|
;
|
|
|
|
|
|
EspEnumStart
|
|
|
- : ESPENUM EspMetaData ID
|
|
|
+ : ESPENUM EspMetaData ID
|
|
|
{
|
|
|
CurEspMessage = new EspMessageInfo($3.getName(), EspMessageInfo::espm_enum);
|
|
|
CurEspMessage->tags = getClearCurMetaTags();
|
|
@@ -319,7 +319,7 @@ EnumBase
|
|
|
if (CurEspMessage->getParentName())
|
|
|
yyerror("parent is already specified by meta extends");
|
|
|
CurEspMessage->setParentName($2.getName());
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
|
{
|
|
|
yyerror("base type must be specified for enumeration type");
|
|
@@ -346,7 +346,7 @@ EnumBaseType
|
|
|
;
|
|
|
|
|
|
EnumBody
|
|
|
- : '{' EnumList OptionalComma '}'
|
|
|
+ : '{' EnumList OptionalComma '}'
|
|
|
{
|
|
|
CurParam=NULL;
|
|
|
LastParam=NULL;
|
|
@@ -356,7 +356,7 @@ EnumBody
|
|
|
;
|
|
|
|
|
|
EnumList
|
|
|
- : EnumItemDef
|
|
|
+ : EnumItemDef
|
|
|
| EnumList ',' EnumItemDef
|
|
|
;
|
|
|
|
|
@@ -367,7 +367,7 @@ EnumItemDef
|
|
|
CurParam->name = strdup($1.getName());
|
|
|
CurParam->kind = TK_ENUM;
|
|
|
CurParam->tags = getClearCurMetaTags();
|
|
|
- AddEspProperty();
|
|
|
+ AddEspProperty();
|
|
|
}
|
|
|
| ID '(' EnumConstValue ',' string_const ')'
|
|
|
{
|
|
@@ -376,7 +376,7 @@ EnumItemDef
|
|
|
CurParam->kind = TK_ENUM;
|
|
|
AddMetaTag(new MetaTagInfo("desc", $5.getString()));
|
|
|
CurParam->tags = getClearCurMetaTags();;
|
|
|
- AddEspProperty();
|
|
|
+ AddEspProperty();
|
|
|
}
|
|
|
| ID
|
|
|
{
|
|
@@ -386,7 +386,7 @@ EnumItemDef
|
|
|
AddMetaTag(new MetaTagInfo("enum", VStrBuffer("\"%s\"", $1.getName()).str()));
|
|
|
CurParam->tags = getClearCurMetaTags();
|
|
|
|
|
|
- AddEspProperty();
|
|
|
+ AddEspProperty();
|
|
|
}
|
|
|
;
|
|
|
|
|
@@ -422,7 +422,7 @@ EspRequest
|
|
|
;
|
|
|
|
|
|
EspRequestStart
|
|
|
- : ESPREQUEST EspMetaData ID
|
|
|
+ : ESPREQUEST EspMetaData ID
|
|
|
{
|
|
|
CurEspMessage = new EspMessageInfo($3.getName(), EspMessageInfo::espm_request);
|
|
|
CurEspMessage->tags = getClearCurMetaTags();
|
|
@@ -454,17 +454,17 @@ OptionalExtends
|
|
|
if (CurEspMessage->getParentName())
|
|
|
yyerror("parent is already specified by meta extends");
|
|
|
CurEspMessage->setParentName($2.getName());
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
|
;
|
|
|
|
|
|
EspMessageBody
|
|
|
- : '{' EspPropertyList '}'
|
|
|
+ : '{' EspPropertyList '}'
|
|
|
{
|
|
|
CurParam=NULL;
|
|
|
LastParam=NULL;
|
|
|
}
|
|
|
- | '{' '}'
|
|
|
+ | '{' '}'
|
|
|
;
|
|
|
|
|
|
EspPropertyList
|
|
@@ -477,20 +477,20 @@ EspPropertyDef
|
|
|
{
|
|
|
if (CurParam)
|
|
|
{
|
|
|
- if (CurParam->name && ((CurParam->flags & PF_RETURN)==0))
|
|
|
+ if (CurParam->name && ((CurParam->flags & PF_RETURN)==0))
|
|
|
{
|
|
|
- if (CurParam->kind==TK_null)
|
|
|
+ if (CurParam->kind==TK_null)
|
|
|
{
|
|
|
CurParam->kind = TK_STRUCT;
|
|
|
CurParam->typname = CurParam->name;
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
errnum = 9;
|
|
|
yyerror("unknown/unexpected ID");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
CurParam->flags |= PF_TEMPLATE;
|
|
|
CurParam->templ = strdup($2.getName());
|
|
|
CurParam->name = strdup($6.getName());
|
|
@@ -498,26 +498,26 @@ EspPropertyDef
|
|
|
}
|
|
|
else
|
|
|
CurMetaTags=NULL;
|
|
|
- AddEspProperty();
|
|
|
+ AddEspProperty();
|
|
|
}
|
|
|
| EspTemplateStart ESPTEMPLATE '<' EspTemplateParams ',' ID '>' ID EspPropertyInit ';'
|
|
|
{
|
|
|
if (CurParam)
|
|
|
{
|
|
|
- if (CurParam->name && ((CurParam->flags & PF_RETURN)==0))
|
|
|
+ if (CurParam->name && ((CurParam->flags & PF_RETURN)==0))
|
|
|
{
|
|
|
- if (CurParam->kind==TK_null)
|
|
|
+ if (CurParam->kind==TK_null)
|
|
|
{
|
|
|
CurParam->kind = TK_STRUCT;
|
|
|
CurParam->typname = CurParam->name;
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
errnum = 21;
|
|
|
yyerror("invalid type declaration in template");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
CurParam->flags |= PF_TEMPLATE;
|
|
|
CurParam->templ = strdup($2.getName());
|
|
|
CurParam->name = strdup($8.getName());
|
|
@@ -528,7 +528,7 @@ EspPropertyDef
|
|
|
}
|
|
|
else
|
|
|
CurMetaTags=NULL;
|
|
|
- AddEspProperty();
|
|
|
+ AddEspProperty();
|
|
|
}
|
|
|
| EspTemplateStart ESPTEMPLATE '<' EspType ID '>' ID ';'
|
|
|
{
|
|
@@ -543,7 +543,7 @@ EspPropertyDef
|
|
|
}
|
|
|
else
|
|
|
CurMetaTags=NULL;
|
|
|
- AddEspProperty();
|
|
|
+ AddEspProperty();
|
|
|
}
|
|
|
| EspTemplateStart ESPTEMPLATE '<' EspType ID ',' ID '>' ID ';'
|
|
|
{
|
|
@@ -561,7 +561,7 @@ EspPropertyDef
|
|
|
}
|
|
|
else
|
|
|
CurMetaTags=NULL;
|
|
|
- AddEspProperty();
|
|
|
+ AddEspProperty();
|
|
|
}
|
|
|
| EspPropertyStart StartParam ESPSTRUCTREF ID ID ';'
|
|
|
{
|
|
@@ -571,7 +571,7 @@ EspPropertyDef
|
|
|
CurParam->typname=strdup($4.getName());
|
|
|
CurParam->kind=TK_ESPSTRUCT;
|
|
|
CurParam->tags = getClearCurMetaTags();
|
|
|
- AddEspProperty();
|
|
|
+ AddEspProperty();
|
|
|
}
|
|
|
}
|
|
|
| EspPropertyStart StartParam ESPENUMREF ID ID OptEspEnumInit ';'
|
|
@@ -582,7 +582,7 @@ EspPropertyDef
|
|
|
CurParam->typname=strdup($4.getName());
|
|
|
CurParam->kind=TK_ESPENUM;
|
|
|
CurParam->tags = getClearCurMetaTags();
|
|
|
- AddEspProperty();
|
|
|
+ AddEspProperty();
|
|
|
}
|
|
|
}
|
|
|
| EspPropertyStart Param EspPropertyInit ';'
|
|
@@ -596,7 +596,7 @@ EspPropertyDef
|
|
|
CurParam->kind=TK_INT;
|
|
|
}
|
|
|
CurParam->tags = getClearCurMetaTags();
|
|
|
- AddEspProperty();
|
|
|
+ AddEspProperty();
|
|
|
}
|
|
|
}
|
|
|
;
|
|
@@ -610,7 +610,7 @@ OptEspEnumInit
|
|
|
{
|
|
|
AddMetaTag(new MetaTagInfo("default", $2.getString()));
|
|
|
}
|
|
|
- |
|
|
|
+ |
|
|
|
{
|
|
|
}
|
|
|
;
|
|
@@ -648,7 +648,7 @@ EspPropertyInit
|
|
|
{
|
|
|
AddMetaTag(new MetaTagInfo("default", 0));
|
|
|
}
|
|
|
- |
|
|
|
+ |
|
|
|
{
|
|
|
//AddMetaTag(new MetaTagInfo("default", 0));
|
|
|
}
|
|
@@ -702,7 +702,7 @@ EspMetaData
|
|
|
|
|
|
EspMetaPropertyList
|
|
|
: EspMetaProperty
|
|
|
- | EspMetaPropertyList ',' EspMetaProperty
|
|
|
+ | EspMetaPropertyList ',' EspMetaProperty
|
|
|
;
|
|
|
|
|
|
EspMetaProperty
|
|
@@ -737,7 +737,7 @@ Module
|
|
|
}
|
|
|
;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
ModuleStart
|
|
|
: MODULE ID
|
|
|
{
|
|
@@ -761,7 +761,7 @@ ModuleVersion
|
|
|
{
|
|
|
errnum = 5;
|
|
|
yyerror("version must be in range 0-255");
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
| '(' ID ')'
|
|
|
{
|
|
@@ -771,8 +771,8 @@ ModuleVersion
|
|
|
;
|
|
|
|
|
|
ModuleBody
|
|
|
- : '{' ProcDefList '}'
|
|
|
- | '{' '}'
|
|
|
+ : '{' ProcDefList '}'
|
|
|
+ | '{' '}'
|
|
|
;
|
|
|
|
|
|
|
|
@@ -784,7 +784,7 @@ Enumeration
|
|
|
}
|
|
|
;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
EnumerationStart
|
|
|
: SCMENUM ID
|
|
|
{
|
|
@@ -795,7 +795,7 @@ EnumerationStart
|
|
|
;
|
|
|
|
|
|
EnumerationBody
|
|
|
- : '{' EnumDefList '}'
|
|
|
+ : '{' EnumDefList '}'
|
|
|
;
|
|
|
|
|
|
|
|
@@ -817,18 +817,18 @@ EnumDefList
|
|
|
{
|
|
|
LastEnumVal->next = CurEnumVal;
|
|
|
LastEnumVal = CurEnumVal;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
;
|
|
|
|
|
|
EnumDef
|
|
|
- : ID '=' INTEGER_CONST
|
|
|
+ : ID '=' INTEGER_CONST
|
|
|
{
|
|
|
EnumValue = $3.getInt();
|
|
|
CurEnumVal = new EnumValInfo($1.getName(),EnumValue);
|
|
|
EnumValue++;
|
|
|
}
|
|
|
- | ID '=' '-' INTEGER_CONST
|
|
|
+ | ID '=' '-' INTEGER_CONST
|
|
|
{
|
|
|
EnumValue = - $3.getInt();
|
|
|
CurEnumVal = new EnumValInfo($1.getName(),EnumValue);
|
|
@@ -921,7 +921,7 @@ ProcDefList
|
|
|
{
|
|
|
LastProc->next = CurProc;
|
|
|
LastProc = CurProc;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
;
|
|
|
|
|
@@ -943,9 +943,9 @@ ProcAttr
|
|
|
ProcAttrList
|
|
|
: ProcAttr ProcAttrList
|
|
|
|
|
|
|
- ;
|
|
|
+ ;
|
|
|
+
|
|
|
|
|
|
-
|
|
|
RetParam
|
|
|
: StartRetParam TypeModifiers TypeList
|
|
|
{
|
|
@@ -994,7 +994,7 @@ TypeModifiers
|
|
|
: TypeModifier TypeModifiers
|
|
|
|
|
|
|
;
|
|
|
-
|
|
|
+
|
|
|
TypeModifier
|
|
|
: InOut
|
|
|
| String
|
|
@@ -1003,7 +1003,7 @@ TypeModifier
|
|
|
;
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
Layout
|
|
|
: LAYOUT '(' LayoutParams ')'
|
|
|
{
|
|
@@ -1057,7 +1057,7 @@ LayoutSizeVal
|
|
|
;
|
|
|
|
|
|
StartLayout
|
|
|
- :
|
|
|
+ :
|
|
|
{
|
|
|
CurLayout = new LayoutInfo;
|
|
|
}
|
|
@@ -1136,13 +1136,13 @@ Type
|
|
|
{
|
|
|
switch(CurParam->kind)
|
|
|
{
|
|
|
- case TK_UNSIGNED:
|
|
|
- CurParam->kind = TK_UNSIGNEDCHAR;
|
|
|
+ case TK_UNSIGNED:
|
|
|
+ CurParam->kind = TK_UNSIGNEDCHAR;
|
|
|
break;
|
|
|
case TK_null:
|
|
|
- CurParam->kind = TK_CHAR;
|
|
|
+ CurParam->kind = TK_CHAR;
|
|
|
break;
|
|
|
- default:
|
|
|
+ default:
|
|
|
{
|
|
|
errnum = 7;
|
|
|
yyerror("invalid type");
|
|
@@ -1154,9 +1154,9 @@ Type
|
|
|
switch(CurParam->kind)
|
|
|
{
|
|
|
case TK_null:
|
|
|
- CurParam->kind = TK_BYTE;
|
|
|
+ CurParam->kind = TK_BYTE;
|
|
|
break;
|
|
|
- default:
|
|
|
+ default:
|
|
|
{
|
|
|
errnum = 7;
|
|
|
yyerror("invalid type");
|
|
@@ -1168,9 +1168,9 @@ Type
|
|
|
switch(CurParam->kind)
|
|
|
{
|
|
|
case TK_null:
|
|
|
- CurParam->kind = TK_BOOL;
|
|
|
+ CurParam->kind = TK_BOOL;
|
|
|
break;
|
|
|
- default:
|
|
|
+ default:
|
|
|
{
|
|
|
errnum = 7;
|
|
|
yyerror("invalid type");
|
|
@@ -1181,13 +1181,13 @@ Type
|
|
|
{
|
|
|
switch(CurParam->kind)
|
|
|
{
|
|
|
- case TK_UNSIGNED:
|
|
|
- CurParam->kind = TK_UNSIGNEDSHORT;
|
|
|
+ case TK_UNSIGNED:
|
|
|
+ CurParam->kind = TK_UNSIGNEDSHORT;
|
|
|
break;
|
|
|
case TK_null:
|
|
|
- CurParam->kind = TK_SHORT;
|
|
|
+ CurParam->kind = TK_SHORT;
|
|
|
break;
|
|
|
- default:
|
|
|
+ default:
|
|
|
{
|
|
|
errnum = 7;
|
|
|
yyerror("invalid type");
|
|
@@ -1202,18 +1202,18 @@ Type
|
|
|
{
|
|
|
switch(CurParam->kind)
|
|
|
{
|
|
|
- case TK_UNSIGNED:
|
|
|
+ case TK_UNSIGNED:
|
|
|
break;
|
|
|
case TK_SHORT:
|
|
|
- CurParam->kind = TK_SHORT;
|
|
|
+ CurParam->kind = TK_SHORT;
|
|
|
break;
|
|
|
case TK_LONG:
|
|
|
CurParam->kind = TK_LONG;
|
|
|
- break;
|
|
|
+ break;
|
|
|
case TK_null:
|
|
|
- CurParam->kind = TK_INT;
|
|
|
+ CurParam->kind = TK_INT;
|
|
|
break;
|
|
|
- default:
|
|
|
+ default:
|
|
|
{
|
|
|
errnum = 7;
|
|
|
yyerror("invalid type");
|
|
@@ -1225,9 +1225,9 @@ Type
|
|
|
switch(CurParam->kind)
|
|
|
{
|
|
|
case TK_null:
|
|
|
- CurParam->kind = TK_UNSIGNED;
|
|
|
+ CurParam->kind = TK_UNSIGNED;
|
|
|
break;
|
|
|
- default:
|
|
|
+ default:
|
|
|
{
|
|
|
errnum = 7;
|
|
|
yyerror("invalid type");
|
|
@@ -1241,16 +1241,16 @@ Type
|
|
|
case TK_LONG:
|
|
|
CurParam->kind = TK_LONGLONG;
|
|
|
break;
|
|
|
- case TK_UNSIGNED:
|
|
|
- CurParam->kind = TK_UNSIGNEDLONG;
|
|
|
+ case TK_UNSIGNED:
|
|
|
+ CurParam->kind = TK_UNSIGNEDLONG;
|
|
|
break;
|
|
|
case TK_UNSIGNEDLONG:
|
|
|
CurParam->kind = TK_UNSIGNEDLONGLONG;
|
|
|
break;
|
|
|
case TK_null:
|
|
|
- CurParam->kind = TK_LONG;
|
|
|
+ CurParam->kind = TK_LONG;
|
|
|
break;
|
|
|
- default:
|
|
|
+ default:
|
|
|
{
|
|
|
errnum = 7;
|
|
|
yyerror("invalid type");
|
|
@@ -1259,7 +1259,7 @@ Type
|
|
|
}
|
|
|
| STAR
|
|
|
{
|
|
|
- if (CurParam->flags&(PF_PTR|PF_REF))
|
|
|
+ if (CurParam->flags&(PF_PTR|PF_REF))
|
|
|
{
|
|
|
errnum = 8;
|
|
|
yyerror("parameter type not supported");
|
|
@@ -1268,10 +1268,10 @@ Type
|
|
|
{
|
|
|
CurParam->flags|=PF_PTR;
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
| UMBERSAND
|
|
|
{
|
|
|
- if (CurParam->flags&(PF_REF))
|
|
|
+ if (CurParam->flags&(PF_REF))
|
|
|
{
|
|
|
errnum = 8;
|
|
|
yyerror("parameter type not supported");
|
|
@@ -1280,7 +1280,7 @@ Type
|
|
|
{
|
|
|
CurParam->flags|=PF_REF;
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
| ESDL_CONST
|
|
|
{
|
|
|
CurParam->flags |= PF_CONST;
|
|
@@ -1290,9 +1290,9 @@ Type
|
|
|
switch(CurParam->kind)
|
|
|
{
|
|
|
case TK_null:
|
|
|
- CurParam->kind = TK_DOUBLE;
|
|
|
+ CurParam->kind = TK_DOUBLE;
|
|
|
break;
|
|
|
- default:
|
|
|
+ default:
|
|
|
{
|
|
|
errnum = 7;
|
|
|
yyerror("invalid type");
|
|
@@ -1304,9 +1304,9 @@ Type
|
|
|
switch(CurParam->kind)
|
|
|
{
|
|
|
case TK_null:
|
|
|
- CurParam->kind = TK_FLOAT;
|
|
|
+ CurParam->kind = TK_FLOAT;
|
|
|
break;
|
|
|
- default:
|
|
|
+ default:
|
|
|
{
|
|
|
errnum = 7;
|
|
|
yyerror("invalid type");
|
|
@@ -1321,38 +1321,38 @@ Type
|
|
|
{
|
|
|
if (rettype)
|
|
|
{
|
|
|
- if (!CurParam)
|
|
|
+ if (!CurParam)
|
|
|
{
|
|
|
errnum = 9;
|
|
|
yyerror("unknown/unexpected ID");
|
|
|
}
|
|
|
- else if (CurParam->kind==TK_null)
|
|
|
+ else if (CurParam->kind==TK_null)
|
|
|
{
|
|
|
CurParam->kind = TK_STRUCT;
|
|
|
CurParam->typname = strdup($1.getName());
|
|
|
- }
|
|
|
- else if ((CurParam->kind==TK_VOID)&&((CurParam->flags&PF_PTR)==0))
|
|
|
+ }
|
|
|
+ else if ((CurParam->kind==TK_VOID)&&((CurParam->flags&PF_PTR)==0))
|
|
|
{
|
|
|
CurProc->name = strdup($1.getName());
|
|
|
delete CurParam;
|
|
|
CurParam = NULL;
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
CurParam->flags |= (PF_OUT|PF_RETURN);
|
|
|
check_param();
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
if (CurParam)
|
|
|
{
|
|
|
- if (CurParam->name && ((CurParam->flags&PF_RETURN)==0))
|
|
|
+ if (CurParam->name && ((CurParam->flags&PF_RETURN)==0))
|
|
|
{
|
|
|
- if (CurParam->kind==TK_null)
|
|
|
+ if (CurParam->kind==TK_null)
|
|
|
{
|
|
|
CurParam->kind = TK_STRUCT;
|
|
|
CurParam->typname = CurParam->name;
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
errnum = 9;
|
|
|
yyerror("unknown/unexpected ID");
|
|
@@ -1360,7 +1360,7 @@ Type
|
|
|
}
|
|
|
CurParam->name = strdup($1.getName());
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
// | ESPTEMPLATE
|
|
|
;
|
|
|
|
|
@@ -1379,7 +1379,7 @@ Virtual
|
|
|
if (CurProc->virt==0)
|
|
|
CurProc->virt = 1;
|
|
|
}
|
|
|
- ;
|
|
|
+ ;
|
|
|
|
|
|
Abstract
|
|
|
: '=' INTEGER_CONST
|
|
@@ -1390,7 +1390,7 @@ Abstract
|
|
|
{
|
|
|
errnum = 10;
|
|
|
yyerror("abstract not allowed on non-virtual");
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
;
|
|
@@ -1414,7 +1414,7 @@ Async
|
|
|
: ASYNC
|
|
|
{
|
|
|
CurProc->async = 1;
|
|
|
- }
|
|
|
+ }
|
|
|
;
|
|
|
|
|
|
Timeout
|
|
@@ -1436,7 +1436,7 @@ string_const
|
|
|
memcpy(s+len1, $2.getString(), len2+1);
|
|
|
$$.setVal(s);
|
|
|
}
|
|
|
- ;
|
|
|
+ ;
|
|
|
|
|
|
/************************ END OF RULES **********************/
|
|
|
|
|
@@ -1546,19 +1546,19 @@ MetaTagInfo* getClearCurMetaTags()
|
|
|
{
|
|
|
// alias
|
|
|
if (streq("deprecated_ver",t->getName()))
|
|
|
- t->setName("depr_ver");
|
|
|
+ t->setName("depr_ver");
|
|
|
|
|
|
- if (tagNames.find(t->getName())!= tagNames.end())
|
|
|
+ if (tagNames.find(t->getName())!= tagNames.end())
|
|
|
{
|
|
|
VStrBuffer msg("Attribute '%s' are declared more than once", t->getName());
|
|
|
yyerror(msg.str());
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
+ else
|
|
|
+ {
|
|
|
if ( (streq("depr_ver",t->getName()) && tagNames.find("max_ver")!=tagNames.end())
|
|
|
|| (streq("max_ver",t->getName()) && tagNames.find("depr_ver")!=tagNames.end()) )
|
|
|
yyerror("max_ver and depr_ver can not be used together");
|
|
|
-
|
|
|
+
|
|
|
tagNames.insert(t->getName());
|
|
|
}
|
|
|
}
|
|
@@ -1583,7 +1583,7 @@ void AddEnum()
|
|
|
|
|
|
extern char *yytext;
|
|
|
void yyerror(const char *s)
|
|
|
-{
|
|
|
+{
|
|
|
if (!errnum)
|
|
|
errnum = 99;
|
|
|
if (yytext[0] == '\n')
|
|
@@ -1591,8 +1591,8 @@ void yyerror(const char *s)
|
|
|
yytext = (char*)strdup("EOL");
|
|
|
}
|
|
|
// the following error format work with Visual Studio double click.
|
|
|
- printf("%s(%d) : syntax error H%d : %s near \"%s\"\n",hcp->filename, linenum, errnum, s, yytext);
|
|
|
- outf("*** %s(%d) syntax error H%d : %s near \"%s\"\n",hcp->filename, linenum, errnum, s, yytext);
|
|
|
+ printf("%s(%d) : syntax error H%d : %s near \"%s\"\n",hcp->filename, linenum, errnum, s, yytext);
|
|
|
+ outf("*** %s(%d) syntax error H%d : %s near \"%s\"\n",hcp->filename, linenum, errnum, s, yytext);
|
|
|
errnum = 0;
|
|
|
}
|
|
|
|
|
@@ -1600,17 +1600,17 @@ void check_param(void)
|
|
|
{
|
|
|
if ((CurParam->flags&PF_PTR)&&(CurParam->kind==TK_CHAR))
|
|
|
CurParam->flags |= PF_STRING;
|
|
|
- if ((CurProc->async)&&(CurParam->flags&(PF_OUT|PF_RETURN)))
|
|
|
+ if ((CurProc->async)&&(CurParam->flags&(PF_OUT|PF_RETURN)))
|
|
|
{
|
|
|
errnum = 1;
|
|
|
yyerror("out parameters not allowed on async procedure");
|
|
|
}
|
|
|
- if ((CurParam->flags&(PF_CONST&PF_OUT))==(PF_CONST|PF_OUT))
|
|
|
+ if ((CurParam->flags&(PF_CONST&PF_OUT))==(PF_CONST|PF_OUT))
|
|
|
{
|
|
|
errnum = 2;
|
|
|
yyerror("const not allowed on out parameter");
|
|
|
}
|
|
|
- switch (CurParam->flags&(PF_IN|PF_OUT|PF_STRING|PF_VARSIZE|PF_PTR|PF_REF|PF_RETURN))
|
|
|
+ switch (CurParam->flags&(PF_IN|PF_OUT|PF_STRING|PF_VARSIZE|PF_PTR|PF_REF|PF_RETURN))
|
|
|
{
|
|
|
case PF_IN: // int T
|
|
|
case (PF_IN|PF_REF): // in T&
|
|
@@ -1622,11 +1622,11 @@ void check_param(void)
|
|
|
case (PF_OUT|PF_PTR|PF_REF|PF_VARSIZE): // inout size() T*&
|
|
|
case (PF_IN|PF_PTR|PF_STRING): // in string const char *
|
|
|
case (PF_OUT|PF_PTR|PF_REF|PF_STRING): // out string char *&
|
|
|
- case (PF_OUT|PF_RETURN): // return simple
|
|
|
+ case (PF_OUT|PF_RETURN): // return simple
|
|
|
case (PF_OUT|PF_PTR|PF_VARSIZE|PF_RETURN): // return size() T*
|
|
|
case (PF_OUT|PF_PTR|PF_STRING|PF_RETURN): // return out string char *
|
|
|
break;
|
|
|
- case (PF_OUT|PF_PTR|PF_RETURN): // return T*
|
|
|
+ case (PF_OUT|PF_PTR|PF_RETURN): // return T*
|
|
|
case (PF_OUT|PF_REF|PF_RETURN): // return T&
|
|
|
break;
|
|
|
default:
|