Menu

#21 SINGLELETTER in ruleset_parser.yy

v0.8x
open
nobody
None
5
2013-10-27
2013-10-27
Jim O'Regan
No

ruleset_parser.yy: In function 'int ruleset_parse()':
ruleset_parser.yy:410: error: invalid conversion from 'char' to 'int'
ruleset_parser.yy:838: error: invalid conversion from 'char
' to 'char'

I'm not sure if I'm following what's intended, but this compiles for me:

--- ruleset_parser.yy.orig 2013-10-27 12:04:18.000000000 +0000
+++ ruleset_parser.yy 2013-10-27 12:04:20.000000000 +0000
@@ -407,7 +407,7 @@
ruleset_parser_flags);
}

-letterref: SINGLELETTER { $$ = LETTER_REF_ID_BASE + $1;
+letterref: SINGLELETTER { $$ = LETTER_REF_ID_BASE + $1[0];
if (ruleset_parser_refs_prohibided){
std::stringstream ss;
ss << "Reference '" << $1 <<
@@ -835,7 +835,7 @@
;

ident: IDENT {$$ = $1;}

  • | SINGLELETTER {$$ = (char *)malloc(2); $$[0] = $1; $$[1] = 0;}
  • | SINGLELETTER {$$ = (char )malloc(2); $$[0] = ($1); $$[1] = 0;}
    ;

Discussion

  • Jim O'Regan

    Jim O'Regan - 2013-10-27

    I was way off :)

    The change that fixed it was:

    @@ -167,7 +167,8 @@
    %token QUESTION
    %token SEMICOLON
    %token COLON
    -%token <str> NUMBER SINGLELETTER
    +%token <str> NUMBER
    +%token <num> SINGLELETTER</num></str></str>

     
  • Jim O'Regan

    Jim O'Regan - 2013-10-27

    Sorry, sourceforge swallowed the HTML-looking parts

     
  • Bartosz Zaborowski

    Seems OK, great thanks:)

     

Log in to post a comment.

Auth0 Logo