mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-12 09:59:03 +08:00
0031970: Data Exchange, STEP reader - parser syntax error messages are inaccessible
- Upgraded files using new version of WinFlexBison - Removed global variables within StepFile_Read.cxx - Upgraded error message during bison analyzing ( added a expected expression information ) - Used 'Interface_ParamType' as argument type for the StepFile_ReadData::Argument for a compatibility with the StepData/StepData_StepReaderData - Added handling parse errors and transferring it to the StepData_StepReaderData - Now parsing and referencing errors save in the check and non output by default - Step_file's and Step_Data's output info prints according by trace level of printer - Removed useless location.hxx - Removed TraceLevel for the StepFile_Reader ( now it useless, it is 0 by default and newer and nowhere change ) - Translate error message into English within StepData_StepReaderData - Replace "Error" word in the output messages
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
#ifdef YY_DECL
|
||||
# undef YY_DECL
|
||||
#endif
|
||||
#define YY_DECL int step::scanner::lex (step::parser::semantic_type* /*yylval*/, step::parser::location_type* /*yylloc*/)
|
||||
#define YY_DECL int step::scanner::lex (step::parser::semantic_type* /*yylval*/)
|
||||
|
||||
typedef step::parser::token token;
|
||||
|
||||
@@ -97,7 +97,7 @@ long string in files Henri.stp and 401.stp*/
|
||||
<Text>[\n] { yymore(); yylineno ++; } /* newline in text string - increment line counter and keep collecting yytext */
|
||||
<Text>['] { yymore(); } /* single ' inside text string - keep collecting yytext*/
|
||||
<Text>[^\n']+ { yymore(); } /* a sequence of any characters except ' and \n - keep collecting yytext */
|
||||
<Text>[']/[" "\n\r]*[\)\,] { BEGIN(INITIAL); CreateNewText(YYText(),YYLeng()); SetTypeArg(ArgumentType_Text); return(token::QUID); } /* end of string (apostrophe followed by comma or closing parenthesis) - reset the scanner to initial state, record the value of all yytext collected */
|
||||
<Text>[']/[" "\n\r]*[\)\,] { BEGIN(INITIAL); CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamText); return(token::QUID); } /* end of string (apostrophe followed by comma or closing parenthesis) - reset the scanner to initial state, record the value of all yytext collected */
|
||||
|
||||
" " {;}
|
||||
" " {;}
|
||||
@@ -108,15 +108,15 @@ long string in files Henri.stp and 401.stp*/
|
||||
#[0-9]+/= { CreateNewText(YYText(),YYLeng()); return(token::ENTITY); }
|
||||
#[0-9]+/[ ]*= { CreateNewText(YYText(),YYLeng()); return(token::ENTITY); }
|
||||
#[0-9]+ { CreateNewText(YYText(),YYLeng()); return(token::IDENT); }
|
||||
[-+0-9][0-9]* { CreateNewText(YYText(),YYLeng()); SetTypeArg(ArgumentType_Integer); return(token::QUID); }
|
||||
[-+\.0-9][\.0-9]+ { CreateNewText(YYText(),YYLeng()); SetTypeArg(ArgumentType_Float); return(token::QUID); }
|
||||
[-+\.0-9][\.0-9]+E[-+0-9][0-9]* { CreateNewText(YYText(),YYLeng()); SetTypeArg(ArgumentType_Float); return(token::QUID); }
|
||||
["][0-9A-F]+["] { CreateNewText(YYText(),YYLeng()); SetTypeArg(ArgumentType_Hexa); return(token::QUID); }
|
||||
[.]*[A-Z0-9_]+[.] { CreateNewText(YYText(),YYLeng()); SetTypeArg(ArgumentType_Enum); return(token::QUID); }
|
||||
[-+0-9][0-9]* { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamInteger); return(token::QUID); }
|
||||
[-+\.0-9][\.0-9]+ { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamReal); return(token::QUID); }
|
||||
[-+\.0-9][\.0-9]+E[-+0-9][0-9]* { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamReal); return(token::QUID); }
|
||||
["][0-9A-F]+["] { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamHexa); return(token::QUID); }
|
||||
[.]*[A-Z0-9_]+[.] { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamEnum); return(token::QUID); }
|
||||
[(] { return ('('); }
|
||||
[)] { return (')'); }
|
||||
[,] { myDataModel->PrepareNewArg(); return (','); }
|
||||
[$] { CreateNewText(YYText(),YYLeng()); SetTypeArg(ArgumentType_Nondef); return(token::QUID); }
|
||||
[$] { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamVoid); return(token::QUID); }
|
||||
[=] { return ('='); }
|
||||
[;] { return (';'); }
|
||||
|
||||
@@ -134,7 +134,7 @@ long string in files Henri.stp and 401.stp*/
|
||||
(?i:ENDSCOPE) { return(token::ENDSCOPE); }
|
||||
[a-zA-Z0-9_]+ { CreateNewText(YYText(),YYLeng()); return(token::TYPE); }
|
||||
![a-zA-Z0-9_]+ { CreateNewText(YYText(),YYLeng()); return(token::TYPE); }
|
||||
[^)] { CreateNewText(YYText(),YYLeng()); SetTypeArg(ArgumentType_Misc); return(token::QUID); }
|
||||
[^)] { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamMisc); return(token::QUID); }
|
||||
|
||||
<End>[^\n] {;} /* skip any characters (except newlines) */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user