-
Notifications
You must be signed in to change notification settings - Fork 15
Description
I started with the ERDDAP syntax task since I'd like to understand why this was so hard we dropped it. There are no note in the code, but the issue seems to be that in DAP4 '.' is a PATH_SEP in the syntax of the DAP4 CE and so the scanner tokenizes "[(30.6)]..." as LBRACKET LPAREN WORD PATH_SEP and then fails hard.
libdap4/tests % ./dmr-test -S -c "[(45.0)]"
LBRACKET
LPAREN
WORD: 45
PATH_SEP
Assertion failed: (!yytypeid_), function emplace, file d4_ce_parser.tab.hh, line 222.OTOH, "[(30)]..." scans just fine:
libdap4/tests % ./dmr-test -S -c "[(30)]"
LBRACKET
LPAREN
WORD: 30
RPAREN
RBRACKETas does
libdap4/tests % ./dmr-test -S -c "[(45.)]"
LBRACKET
LPAREN
WORD: 45
PATH_SEP
RPAREN
RBRACKETOne possible solution is to define FLOAT as a floating point number and then change the parser so that it will recognize [(WORD)] and [(FLOAT)] as 'value' subsets.
Another possible solution, which might be cleaner for the parser implementation, is to use a scanner state (as we do for strings) to pick out the start of a SUBSET_VALUE when it scans a '(' and grab everything until the closing ')'.