mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
GP-3276 Put all C++ classes in ghidra namespace
This commit is contained in:
parent
ca9a56b5f4
commit
fe137f20f3
217 changed files with 1635 additions and 554 deletions
|
@ -13,14 +13,36 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#line 2 "slghscan.cc"
|
||||
|
||||
#line 4 "slghscan.cc"
|
||||
|
||||
#define YY_INT_ALIGNED short int
|
||||
|
||||
/* A lexical scanner generated by flex */
|
||||
|
||||
#define yy_create_buffer sleigh_create_buffer
|
||||
#define yy_delete_buffer sleigh_delete_buffer
|
||||
#define yy_scan_buffer sleigh_scan_buffer
|
||||
#define yy_scan_string sleigh_scan_string
|
||||
#define yy_scan_bytes sleigh_scan_bytes
|
||||
#define yy_init_buffer sleigh_init_buffer
|
||||
#define yy_flush_buffer sleigh_flush_buffer
|
||||
#define yy_load_buffer_state sleigh_load_buffer_state
|
||||
#define yy_switch_to_buffer sleigh_switch_to_buffer
|
||||
#define yypush_buffer_state sleighpush_buffer_state
|
||||
#define yypop_buffer_state sleighpop_buffer_state
|
||||
#define yyensure_buffer_stack sleighensure_buffer_stack
|
||||
#define yy_flex_debug sleigh_flex_debug
|
||||
#define yyin sleighin
|
||||
#define yyleng sleighleng
|
||||
#define yylex sleighlex
|
||||
#define yylineno sleighlineno
|
||||
#define yyout sleighout
|
||||
#define yyrestart sleighrestart
|
||||
#define yytext sleightext
|
||||
#define yywrap sleighwrap
|
||||
#define yyalloc sleighalloc
|
||||
#define yyrealloc sleighrealloc
|
||||
#define yyfree sleighfree
|
||||
|
||||
#define FLEX_SCANNER
|
||||
#define YY_FLEX_MAJOR_VERSION 2
|
||||
#define YY_FLEX_MINOR_VERSION 6
|
||||
|
@ -29,6 +51,240 @@
|
|||
#define FLEX_BETA
|
||||
#endif
|
||||
|
||||
#ifdef yy_create_buffer
|
||||
#define sleigh_create_buffer_ALREADY_DEFINED
|
||||
#else
|
||||
#define yy_create_buffer sleigh_create_buffer
|
||||
#endif
|
||||
|
||||
#ifdef yy_delete_buffer
|
||||
#define sleigh_delete_buffer_ALREADY_DEFINED
|
||||
#else
|
||||
#define yy_delete_buffer sleigh_delete_buffer
|
||||
#endif
|
||||
|
||||
#ifdef yy_scan_buffer
|
||||
#define sleigh_scan_buffer_ALREADY_DEFINED
|
||||
#else
|
||||
#define yy_scan_buffer sleigh_scan_buffer
|
||||
#endif
|
||||
|
||||
#ifdef yy_scan_string
|
||||
#define sleigh_scan_string_ALREADY_DEFINED
|
||||
#else
|
||||
#define yy_scan_string sleigh_scan_string
|
||||
#endif
|
||||
|
||||
#ifdef yy_scan_bytes
|
||||
#define sleigh_scan_bytes_ALREADY_DEFINED
|
||||
#else
|
||||
#define yy_scan_bytes sleigh_scan_bytes
|
||||
#endif
|
||||
|
||||
#ifdef yy_init_buffer
|
||||
#define sleigh_init_buffer_ALREADY_DEFINED
|
||||
#else
|
||||
#define yy_init_buffer sleigh_init_buffer
|
||||
#endif
|
||||
|
||||
#ifdef yy_flush_buffer
|
||||
#define sleigh_flush_buffer_ALREADY_DEFINED
|
||||
#else
|
||||
#define yy_flush_buffer sleigh_flush_buffer
|
||||
#endif
|
||||
|
||||
#ifdef yy_load_buffer_state
|
||||
#define sleigh_load_buffer_state_ALREADY_DEFINED
|
||||
#else
|
||||
#define yy_load_buffer_state sleigh_load_buffer_state
|
||||
#endif
|
||||
|
||||
#ifdef yy_switch_to_buffer
|
||||
#define sleigh_switch_to_buffer_ALREADY_DEFINED
|
||||
#else
|
||||
#define yy_switch_to_buffer sleigh_switch_to_buffer
|
||||
#endif
|
||||
|
||||
#ifdef yypush_buffer_state
|
||||
#define sleighpush_buffer_state_ALREADY_DEFINED
|
||||
#else
|
||||
#define yypush_buffer_state sleighpush_buffer_state
|
||||
#endif
|
||||
|
||||
#ifdef yypop_buffer_state
|
||||
#define sleighpop_buffer_state_ALREADY_DEFINED
|
||||
#else
|
||||
#define yypop_buffer_state sleighpop_buffer_state
|
||||
#endif
|
||||
|
||||
#ifdef yyensure_buffer_stack
|
||||
#define sleighensure_buffer_stack_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyensure_buffer_stack sleighensure_buffer_stack
|
||||
#endif
|
||||
|
||||
#ifdef yylex
|
||||
#define sleighlex_ALREADY_DEFINED
|
||||
#else
|
||||
#define yylex sleighlex
|
||||
#endif
|
||||
|
||||
#ifdef yyrestart
|
||||
#define sleighrestart_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyrestart sleighrestart
|
||||
#endif
|
||||
|
||||
#ifdef yylex_init
|
||||
#define sleighlex_init_ALREADY_DEFINED
|
||||
#else
|
||||
#define yylex_init sleighlex_init
|
||||
#endif
|
||||
|
||||
#ifdef yylex_init_extra
|
||||
#define sleighlex_init_extra_ALREADY_DEFINED
|
||||
#else
|
||||
#define yylex_init_extra sleighlex_init_extra
|
||||
#endif
|
||||
|
||||
#ifdef yylex_destroy
|
||||
#define sleighlex_destroy_ALREADY_DEFINED
|
||||
#else
|
||||
#define yylex_destroy sleighlex_destroy
|
||||
#endif
|
||||
|
||||
#ifdef yyget_debug
|
||||
#define sleighget_debug_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyget_debug sleighget_debug
|
||||
#endif
|
||||
|
||||
#ifdef yyset_debug
|
||||
#define sleighset_debug_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyset_debug sleighset_debug
|
||||
#endif
|
||||
|
||||
#ifdef yyget_extra
|
||||
#define sleighget_extra_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyget_extra sleighget_extra
|
||||
#endif
|
||||
|
||||
#ifdef yyset_extra
|
||||
#define sleighset_extra_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyset_extra sleighset_extra
|
||||
#endif
|
||||
|
||||
#ifdef yyget_in
|
||||
#define sleighget_in_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyget_in sleighget_in
|
||||
#endif
|
||||
|
||||
#ifdef yyset_in
|
||||
#define sleighset_in_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyset_in sleighset_in
|
||||
#endif
|
||||
|
||||
#ifdef yyget_out
|
||||
#define sleighget_out_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyget_out sleighget_out
|
||||
#endif
|
||||
|
||||
#ifdef yyset_out
|
||||
#define sleighset_out_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyset_out sleighset_out
|
||||
#endif
|
||||
|
||||
#ifdef yyget_leng
|
||||
#define sleighget_leng_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyget_leng sleighget_leng
|
||||
#endif
|
||||
|
||||
#ifdef yyget_text
|
||||
#define sleighget_text_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyget_text sleighget_text
|
||||
#endif
|
||||
|
||||
#ifdef yyget_lineno
|
||||
#define sleighget_lineno_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyget_lineno sleighget_lineno
|
||||
#endif
|
||||
|
||||
#ifdef yyset_lineno
|
||||
#define sleighset_lineno_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyset_lineno sleighset_lineno
|
||||
#endif
|
||||
|
||||
#ifdef yywrap
|
||||
#define sleighwrap_ALREADY_DEFINED
|
||||
#else
|
||||
#define yywrap sleighwrap
|
||||
#endif
|
||||
|
||||
#ifdef yyalloc
|
||||
#define sleighalloc_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyalloc sleighalloc
|
||||
#endif
|
||||
|
||||
#ifdef yyrealloc
|
||||
#define sleighrealloc_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyrealloc sleighrealloc
|
||||
#endif
|
||||
|
||||
#ifdef yyfree
|
||||
#define sleighfree_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyfree sleighfree
|
||||
#endif
|
||||
|
||||
#ifdef yytext
|
||||
#define sleightext_ALREADY_DEFINED
|
||||
#else
|
||||
#define yytext sleightext
|
||||
#endif
|
||||
|
||||
#ifdef yyleng
|
||||
#define sleighleng_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyleng sleighleng
|
||||
#endif
|
||||
|
||||
#ifdef yyin
|
||||
#define sleighin_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyin sleighin
|
||||
#endif
|
||||
|
||||
#ifdef yyout
|
||||
#define sleighout_ALREADY_DEFINED
|
||||
#else
|
||||
#define yyout sleighout
|
||||
#endif
|
||||
|
||||
#ifdef yy_flex_debug
|
||||
#define sleigh_flex_debug_ALREADY_DEFINED
|
||||
#else
|
||||
#define yy_flex_debug sleigh_flex_debug
|
||||
#endif
|
||||
|
||||
#ifdef yylineno
|
||||
#define sleighlineno_ALREADY_DEFINED
|
||||
#else
|
||||
#define yylineno sleighlineno
|
||||
#endif
|
||||
|
||||
/* First, we deal with platform-specific or compiler-specific issues. */
|
||||
|
||||
/* begin standard C headers. */
|
||||
|
@ -879,9 +1135,7 @@ char *yytext;
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "slgh_compile.hh"
|
||||
#include "slghparse.hh"
|
||||
#define yywrap() 1
|
||||
#define sleighwrap() 1
|
||||
#define YY_SKIP_YYWRAP
|
||||
|
||||
/* If we are building don't include unistd.h */
|
||||
|
@ -891,6 +1145,12 @@ char *yytext;
|
|||
static int isatty (int fildes) { return 0; }
|
||||
#endif
|
||||
|
||||
#include "slgh_compile.hh"
|
||||
|
||||
namespace ghidra {
|
||||
|
||||
#include "slghparse.hh"
|
||||
|
||||
struct FileStreamState {
|
||||
YY_BUFFER_STATE lastbuffer; // Last lex buffer corresponding to the stream
|
||||
FILE *file; // The NEW file stream
|
||||
|
@ -1091,7 +1351,7 @@ void expand_preprocmacros(string &str)
|
|||
int4 preprocess(int4 cur_state,int4 blank_state)
|
||||
|
||||
{
|
||||
string str(yytext);
|
||||
string str(sleightext);
|
||||
string::size_type pos = str.find('#');
|
||||
if (pos != string::npos)
|
||||
str.erase(pos);
|
||||
|
@ -1114,11 +1374,11 @@ int4 preprocess(int4 cur_state,int4 blank_state)
|
|||
expand_preprocmacros(fname);
|
||||
slgh->parseFromNewFile(fname);
|
||||
fname = slgh->grabCurrentFilePath();
|
||||
yyin = fopen(fname.c_str(),"r");
|
||||
if (yyin == (FILE *)0)
|
||||
sleighin = fopen(fname.c_str(),"r");
|
||||
if (sleighin == (FILE *)0)
|
||||
preproc_error("Could not open included file "+fname);
|
||||
filebuffers.back().file = yyin;
|
||||
yy_switch_to_buffer( yy_create_buffer(yyin, YY_BUF_SIZE) );
|
||||
filebuffers.back().file = sleighin;
|
||||
sleigh_switch_to_buffer( sleigh_create_buffer(sleighin, YY_BUF_SIZE) );
|
||||
check_to_endofline(s);
|
||||
}
|
||||
}
|
||||
|
@ -1235,81 +1495,81 @@ void preproc_macroexpand(void)
|
|||
filebuffers.push_back(FileStreamState());
|
||||
filebuffers.back().lastbuffer = YY_CURRENT_BUFFER;
|
||||
filebuffers.back().file = (FILE *)0;
|
||||
string macro(yytext);
|
||||
string macro(sleightext);
|
||||
macro.erase(0,2);
|
||||
macro.erase(macro.size()-1,1);
|
||||
string value;
|
||||
if (!slgh->getPreprocValue(macro,value))
|
||||
preproc_error("Unknown preprocessing macro "+macro);
|
||||
yy_switch_to_buffer( yy_scan_string( value.c_str() ) );
|
||||
sleigh_switch_to_buffer( sleigh_scan_string( value.c_str() ) );
|
||||
slgh->parsePreprocMacro();
|
||||
}
|
||||
|
||||
int4 find_symbol(void) {
|
||||
string * newstring = new string(yytext);
|
||||
string * newstring = new string(sleightext);
|
||||
SleighSymbol *sym = slgh->findSymbol(*newstring);
|
||||
if (sym == (SleighSymbol *)0) {
|
||||
yylval.str = newstring;
|
||||
sleighlval.str = newstring;
|
||||
return STRING;
|
||||
}
|
||||
delete newstring;
|
||||
switch(sym->getType()) {
|
||||
case SleighSymbol::section_symbol:
|
||||
yylval.sectionsym = (SectionSymbol *)sym;
|
||||
sleighlval.sectionsym = (SectionSymbol *)sym;
|
||||
return SECTIONSYM;
|
||||
case SleighSymbol::space_symbol:
|
||||
yylval.spacesym = (SpaceSymbol *)sym;
|
||||
sleighlval.spacesym = (SpaceSymbol *)sym;
|
||||
return SPACESYM;
|
||||
case SleighSymbol::token_symbol:
|
||||
yylval.tokensym = (TokenSymbol *)sym;
|
||||
sleighlval.tokensym = (TokenSymbol *)sym;
|
||||
return TOKENSYM;
|
||||
case SleighSymbol::userop_symbol:
|
||||
yylval.useropsym = (UserOpSymbol *)sym;
|
||||
sleighlval.useropsym = (UserOpSymbol *)sym;
|
||||
return USEROPSYM;
|
||||
case SleighSymbol::value_symbol:
|
||||
yylval.valuesym = (ValueSymbol *)sym;
|
||||
sleighlval.valuesym = (ValueSymbol *)sym;
|
||||
return VALUESYM;
|
||||
case SleighSymbol::valuemap_symbol:
|
||||
yylval.valuemapsym = (ValueMapSymbol *)sym;
|
||||
sleighlval.valuemapsym = (ValueMapSymbol *)sym;
|
||||
return VALUEMAPSYM;
|
||||
case SleighSymbol::name_symbol:
|
||||
yylval.namesym = (NameSymbol *)sym;
|
||||
sleighlval.namesym = (NameSymbol *)sym;
|
||||
return NAMESYM;
|
||||
case SleighSymbol::varnode_symbol:
|
||||
yylval.varsym = (VarnodeSymbol *)sym;
|
||||
sleighlval.varsym = (VarnodeSymbol *)sym;
|
||||
return VARSYM;
|
||||
case SleighSymbol::bitrange_symbol:
|
||||
yylval.bitsym = (BitrangeSymbol *)sym;
|
||||
sleighlval.bitsym = (BitrangeSymbol *)sym;
|
||||
return BITSYM;
|
||||
case SleighSymbol::varnodelist_symbol:
|
||||
yylval.varlistsym = (VarnodeListSymbol *)sym;
|
||||
sleighlval.varlistsym = (VarnodeListSymbol *)sym;
|
||||
return VARLISTSYM;
|
||||
case SleighSymbol::operand_symbol:
|
||||
yylval.operandsym = (OperandSymbol *)sym;
|
||||
sleighlval.operandsym = (OperandSymbol *)sym;
|
||||
return OPERANDSYM;
|
||||
case SleighSymbol::start_symbol:
|
||||
yylval.startsym = (StartSymbol *)sym;
|
||||
sleighlval.startsym = (StartSymbol *)sym;
|
||||
return STARTSYM;
|
||||
case SleighSymbol::end_symbol:
|
||||
yylval.endsym = (EndSymbol *)sym;
|
||||
sleighlval.endsym = (EndSymbol *)sym;
|
||||
return ENDSYM;
|
||||
case SleighSymbol::next2_symbol:
|
||||
yylval.next2sym = (Next2Symbol *)sym;
|
||||
sleighlval.next2sym = (Next2Symbol *)sym;
|
||||
return NEXT2SYM;
|
||||
case SleighSymbol::subtable_symbol:
|
||||
yylval.subtablesym = (SubtableSymbol *)sym;
|
||||
sleighlval.subtablesym = (SubtableSymbol *)sym;
|
||||
return SUBTABLESYM;
|
||||
case SleighSymbol::macro_symbol:
|
||||
yylval.macrosym = (MacroSymbol *)sym;
|
||||
sleighlval.macrosym = (MacroSymbol *)sym;
|
||||
return MACROSYM;
|
||||
case SleighSymbol::label_symbol:
|
||||
yylval.labelsym = (LabelSymbol *)sym;
|
||||
sleighlval.labelsym = (LabelSymbol *)sym;
|
||||
return LABELSYM;
|
||||
case SleighSymbol::epsilon_symbol:
|
||||
yylval.specsym = (SpecificSymbol *)sym;
|
||||
sleighlval.specsym = (SpecificSymbol *)sym;
|
||||
return SPECSYM;
|
||||
case SleighSymbol::context_symbol:
|
||||
yylval.contextsym = (ContextSymbol *)sym;
|
||||
sleighlval.contextsym = (ContextSymbol *)sym;
|
||||
return CONTEXTSYM;
|
||||
case SleighSymbol::dummy_symbol:
|
||||
break;
|
||||
|
@ -1317,7 +1577,7 @@ int4 find_symbol(void) {
|
|||
return -1; // Should never reach here
|
||||
}
|
||||
|
||||
int4 scan_number(char *numtext,YYSTYPE *lval,bool signednum)
|
||||
int4 scan_number(char *numtext,SLEIGHSTYPE *lval,bool signednum)
|
||||
|
||||
{
|
||||
uintb val;
|
||||
|
@ -1346,6 +1606,10 @@ int4 scan_number(char *numtext,YYSTYPE *lval,bool signednum)
|
|||
return INTEGER;
|
||||
}
|
||||
|
||||
} // End namespace ghidra
|
||||
|
||||
using namespace ghidra;
|
||||
|
||||
#define INITIAL 0
|
||||
#define defblock 1
|
||||
#define macroblock 2
|
||||
|
@ -1638,15 +1902,15 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 3:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 4:
|
||||
YY_RULE_SETUP
|
||||
{ BEGIN(print); slgh->calcContextLayout(); yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ BEGIN(print); slgh->calcContextLayout(); sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 5:
|
||||
YY_RULE_SETUP
|
||||
{ BEGIN(sem); yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ BEGIN(sem); sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 6:
|
||||
YY_RULE_SETUP
|
||||
|
@ -1683,7 +1947,7 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 14:
|
||||
YY_RULE_SETUP
|
||||
{ return yytext[0]; }
|
||||
{ return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 15:
|
||||
/* rule 15 can match eol */
|
||||
|
@ -1696,15 +1960,15 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 17:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 18:
|
||||
YY_RULE_SETUP
|
||||
{ BEGIN(sem); return yytext[0]; }
|
||||
{ BEGIN(sem); return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 19:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.str = new string(yytext); return STRING; }
|
||||
{ sleighlval.str = new string(sleightext); return STRING; }
|
||||
YY_BREAK
|
||||
case 20:
|
||||
YY_RULE_SETUP
|
||||
|
@ -1717,7 +1981,7 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 22:
|
||||
YY_RULE_SETUP
|
||||
{ return yytext[0]; }
|
||||
{ return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 23:
|
||||
/* rule 23 can match eol */
|
||||
|
@ -1730,11 +1994,11 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 25:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 26:
|
||||
YY_RULE_SETUP
|
||||
{ BEGIN(INITIAL); yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ BEGIN(INITIAL); sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 27:
|
||||
YY_RULE_SETUP
|
||||
|
@ -1838,19 +2102,19 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 52:
|
||||
YY_RULE_SETUP
|
||||
{ return scan_number(yytext,&yylval,false); }
|
||||
{ return scan_number(sleightext,&sleighlval,false); }
|
||||
YY_BREAK
|
||||
case 53:
|
||||
YY_RULE_SETUP
|
||||
{ return scan_number(yytext,&yylval,false); }
|
||||
{ return scan_number(sleightext,&sleighlval,false); }
|
||||
YY_BREAK
|
||||
case 54:
|
||||
YY_RULE_SETUP
|
||||
{ return scan_number(yytext,&yylval,false); }
|
||||
{ return scan_number(sleightext,&sleighlval,false); }
|
||||
YY_BREAK
|
||||
case 55:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.str = new string(yytext+1,strlen(yytext)-2); return STRING; }
|
||||
{ sleighlval.str = new string(sleightext+1,strlen(sleightext)-2); return STRING; }
|
||||
YY_BREAK
|
||||
case 56:
|
||||
YY_RULE_SETUP
|
||||
|
@ -1863,7 +2127,7 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 58:
|
||||
YY_RULE_SETUP
|
||||
{ return yytext[0]; }
|
||||
{ return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 59:
|
||||
/* rule 59 can match eol */
|
||||
|
@ -1876,11 +2140,11 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 61:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.ch = yytext[0]; return CHAR; }
|
||||
{ sleighlval.ch = sleightext[0]; return CHAR; }
|
||||
YY_BREAK
|
||||
case 62:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.ch = '^'; return '^'; }
|
||||
{ sleighlval.ch = '^'; return '^'; }
|
||||
YY_BREAK
|
||||
case 63:
|
||||
YY_RULE_SETUP
|
||||
|
@ -1888,15 +2152,15 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 64:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.str = new string(yytext); return SYMBOLSTRING; }
|
||||
{ sleighlval.str = new string(sleightext); return SYMBOLSTRING; }
|
||||
YY_BREAK
|
||||
case 65:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.str = new string(yytext+1,strlen(yytext)-2); return STRING; }
|
||||
{ sleighlval.str = new string(sleightext+1,strlen(sleightext)-2); return STRING; }
|
||||
YY_BREAK
|
||||
case 66:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.ch = ' '; return ' '; }
|
||||
{ sleighlval.ch = ' '; return ' '; }
|
||||
YY_BREAK
|
||||
case 67:
|
||||
/* rule 67 can match eol */
|
||||
|
@ -1905,7 +2169,7 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 68:
|
||||
YY_RULE_SETUP
|
||||
{ return yytext[0]; }
|
||||
{ return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 69:
|
||||
/* rule 69 can match eol */
|
||||
|
@ -1918,7 +2182,7 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 71:
|
||||
YY_RULE_SETUP
|
||||
{ BEGIN((withsection==1) ? INITIAL:sem); withsection=0; yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ BEGIN((withsection==1) ? INITIAL:sem); withsection=0; sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 72:
|
||||
YY_RULE_SETUP
|
||||
|
@ -1966,19 +2230,19 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 83:
|
||||
YY_RULE_SETUP
|
||||
{ actionon = 1; yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ actionon = 1; sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 84:
|
||||
YY_RULE_SETUP
|
||||
{ actionon = 0; yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ actionon = 0; sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 85:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.ch = yytext[0]; return (actionon==0) ? yytext[0] : OP_AND; }
|
||||
{ sleighlval.ch = sleightext[0]; return (actionon==0) ? sleightext[0] : OP_AND; }
|
||||
YY_BREAK
|
||||
case 86:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.ch = yytext[0]; return (actionon==0) ? yytext[0] : OP_OR; }
|
||||
{ sleighlval.ch = sleightext[0]; return (actionon==0) ? sleightext[0] : OP_OR; }
|
||||
YY_BREAK
|
||||
case 87:
|
||||
YY_RULE_SETUP
|
||||
|
@ -1986,7 +2250,7 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 88:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 89:
|
||||
YY_RULE_SETUP
|
||||
|
@ -1998,15 +2262,15 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 91:
|
||||
YY_RULE_SETUP
|
||||
{ return scan_number(yytext,&yylval,true); }
|
||||
{ return scan_number(sleightext,&sleighlval,true); }
|
||||
YY_BREAK
|
||||
case 92:
|
||||
YY_RULE_SETUP
|
||||
{ return scan_number(yytext,&yylval,true); }
|
||||
{ return scan_number(sleightext,&sleighlval,true); }
|
||||
YY_BREAK
|
||||
case 93:
|
||||
YY_RULE_SETUP
|
||||
{ return scan_number(yytext,&yylval,true); }
|
||||
{ return scan_number(sleightext,&sleighlval,true); }
|
||||
YY_BREAK
|
||||
case 94:
|
||||
YY_RULE_SETUP
|
||||
|
@ -2019,7 +2283,7 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 96:
|
||||
YY_RULE_SETUP
|
||||
{ return yytext[0]; }
|
||||
{ return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 97:
|
||||
/* rule 97 can match eol */
|
||||
|
@ -2032,7 +2296,7 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 99:
|
||||
YY_RULE_SETUP
|
||||
{ BEGIN(INITIAL); yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ BEGIN(INITIAL); sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 100:
|
||||
YY_RULE_SETUP
|
||||
|
@ -2252,7 +2516,7 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 154:
|
||||
YY_RULE_SETUP
|
||||
{ yylval.ch = yytext[0]; return yytext[0]; }
|
||||
{ sleighlval.ch = sleightext[0]; return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 155:
|
||||
YY_RULE_SETUP
|
||||
|
@ -2264,15 +2528,15 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 157:
|
||||
YY_RULE_SETUP
|
||||
{ return scan_number(yytext,&yylval,false); }
|
||||
{ return scan_number(sleightext,&sleighlval,false); }
|
||||
YY_BREAK
|
||||
case 158:
|
||||
YY_RULE_SETUP
|
||||
{ return scan_number(yytext,&yylval,false); }
|
||||
{ return scan_number(sleightext,&sleighlval,false); }
|
||||
YY_BREAK
|
||||
case 159:
|
||||
YY_RULE_SETUP
|
||||
{ return scan_number(yytext,&yylval,false); }
|
||||
{ return scan_number(sleightext,&sleighlval,false); }
|
||||
YY_BREAK
|
||||
case 160:
|
||||
YY_RULE_SETUP
|
||||
|
@ -2285,7 +2549,7 @@ YY_RULE_SETUP
|
|||
YY_BREAK
|
||||
case 162:
|
||||
YY_RULE_SETUP
|
||||
{ return yytext[0]; }
|
||||
{ return sleightext[0]; }
|
||||
YY_BREAK
|
||||
case 163:
|
||||
/* rule 163 can match eol */
|
||||
|
@ -2304,10 +2568,10 @@ case YY_STATE_EOF(print):
|
|||
case YY_STATE_EOF(pattern):
|
||||
case YY_STATE_EOF(sem):
|
||||
case YY_STATE_EOF(preproc):
|
||||
{ yy_delete_buffer( YY_CURRENT_BUFFER );
|
||||
{ sleigh_delete_buffer( YY_CURRENT_BUFFER );
|
||||
if (filebuffers.empty())
|
||||
yyterminate();
|
||||
yy_switch_to_buffer( filebuffers.back().lastbuffer );
|
||||
sleigh_switch_to_buffer( filebuffers.back().lastbuffer );
|
||||
FILE *curfile = filebuffers.back().file;
|
||||
if (curfile != (FILE *)0)
|
||||
fclose(curfile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue