diff options
author | FreeArtMan <dos21h@gmail.com> | 2019-08-17 13:26:00 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2019-08-17 13:26:00 +0100 |
commit | 700b5bc2b24bf9fd8e69f0586739c692be0dc2cb (patch) | |
tree | 12a966c2cd9627de71a670d213e330c35a16f551 /libcmd | |
parent | 5483357fa0c2cceb4ed449bd14874c320ccb90a3 (diff) | |
download | ihe-700b5bc2b24bf9fd8e69f0586739c692be0dc2cb.tar.gz ihe-700b5bc2b24bf9fd8e69f0586739c692be0dc2cb.zip |
updated lib, compiles
Diffstat (limited to 'libcmd')
-rw-r--r-- | libcmd/cmd_parse.c | 30 | ||||
-rw-r--r-- | libcmd/cmd_parse.ragel | 6 |
2 files changed, 18 insertions, 18 deletions
diff --git a/libcmd/cmd_parse.c b/libcmd/cmd_parse.c index b9904e9..0377e1d 100644 --- a/libcmd/cmd_parse.c +++ b/libcmd/cmd_parse.c @@ -7,8 +7,8 @@ #define TADD(T,S,E,SZ) {cmd_tok_t *t=cmd_tok_create(S,E,SZ,T);cmd_tok_add(tl,t);tl=tl->next;} //#define TADD(T,S,E) -#define PR_TK_DBG(S) printf(S);fwrite(ts,1,te-ts,stdout);printf("\n"); -//#define PR_TK_DBG(S) ; +//#define PR_TK_DBG(S) printf(S);fwrite(ts,1,te-ts,stdout);printf("\n"); +#define PR_TK_DBG(S) ; char *new_string( const char *start, const char *end ) { @@ -111,7 +111,7 @@ static const int cmd_error = 0; static const int cmd_en_main = 6; -#line 75 "cmd_parse.ragel" +#line 62 "cmd_parse.ragel" int parse_cmd( cmd_tok_t *tl, const char *str, size_t str_size ) @@ -126,7 +126,7 @@ int parse_cmd( cmd_tok_t *tl, const char *str, size_t str_size ) /*save for cmd_begin state*/ //char *ts_cb=0, *te_cb=0; - printf("PE:%s %02x\n",pe,(unsigned char)*pe); + //printf("PE:%s %02x\n",pe,(unsigned char)*pe); /* variables used in state machine @@ -141,7 +141,7 @@ int parse_cmd( cmd_tok_t *tl, const char *str, size_t str_size ) act = 0; } -#line 96 "cmd_parse.ragel" +#line 83 "cmd_parse.ragel" #line 147 "cmd_parse.c" { @@ -235,39 +235,39 @@ _eof_trans: {te = p+1;} break; case 4: -#line 60 "cmd_parse.ragel" +#line 53 "cmd_parse.ragel" {act = 2;} break; case 5: -#line 62 "cmd_parse.ragel" +#line 55 "cmd_parse.ragel" {te = p+1;{PR_TK_DBG("qstr = ");TADD(CMDT_QSTR, ts,te,te-ts);}} break; case 6: -#line 64 "cmd_parse.ragel" +#line 57 "cmd_parse.ragel" {te = p+1;{PR_TK_DBG("sp = ");TADD(CMDT_SP, ts,te,te-ts);}} break; case 7: -#line 59 "cmd_parse.ragel" +#line 52 "cmd_parse.ragel" {te = p;p--;{PR_TK_DBG("hex = ");TADD(CMDT_HEX, ts,te,te-ts);}} break; case 8: -#line 60 "cmd_parse.ragel" +#line 53 "cmd_parse.ragel" {te = p;p--;{PR_TK_DBG("dec = ");TADD(CMDT_INT, ts,te,te-ts);}} break; case 9: -#line 61 "cmd_parse.ragel" +#line 54 "cmd_parse.ragel" {te = p;p--;{PR_TK_DBG("bin = ");TADD(CMDT_BIN, ts,te,te-ts);}} break; case 10: -#line 63 "cmd_parse.ragel" +#line 56 "cmd_parse.ragel" {te = p;p--;{PR_TK_DBG("word = ");TADD(CMDT_WORD, ts,te,te-ts);}} break; case 11: -#line 66 "cmd_parse.ragel" +#line 58 "cmd_parse.ragel" {te = p;p--;{PR_TK_DBG("float= ");TADD(CMDT_FLOAT, ts,te,te-ts);}} break; case 12: -#line 60 "cmd_parse.ragel" +#line 53 "cmd_parse.ragel" {{p = ((te))-1;}{PR_TK_DBG("dec = ");TADD(CMDT_INT, ts,te,te-ts);}} break; case 13: @@ -319,7 +319,7 @@ _again: _out: {} } -#line 97 "cmd_parse.ragel" +#line 84 "cmd_parse.ragel" if ( cs == cmd_error ) { diff --git a/libcmd/cmd_parse.ragel b/libcmd/cmd_parse.ragel index 482ad8d..0775802 100644 --- a/libcmd/cmd_parse.ragel +++ b/libcmd/cmd_parse.ragel @@ -5,8 +5,8 @@ #define TADD(T,S,E,SZ) {cmd_tok_t *t=cmd_tok_create(S,E,SZ,T);cmd_tok_add(tl,t);tl=tl->next;} //#define TADD(T,S,E) -#define PR_TK_DBG(S) printf(S);fwrite(ts,1,te-ts,stdout);printf("\n"); -//#define PR_TK_DBG(S) ; +//#define PR_TK_DBG(S) printf(S);fwrite(ts,1,te-ts,stdout);printf("\n"); +#define PR_TK_DBG(S) ; char *new_string( const char *start, const char *end ) { @@ -73,7 +73,7 @@ int parse_cmd( cmd_tok_t *tl, const char *str, size_t str_size ) /*save for cmd_begin state*/ //char *ts_cb=0, *te_cb=0; - printf("PE:%s %02x\n",pe,(unsigned char)*pe); + //printf("PE:%s %02x\n",pe,(unsigned char)*pe); /* variables used in state machine |