Skip to content

Add support for the ERDDAP syntax to the DAP4 CE scanner and parser. #326

@jgallagher59701

Description

@jgallagher59701

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
RBRACKET

as does

libdap4/tests % ./dmr-test -S -c "[(45.)]"  
LBRACKET
LPAREN
WORD: 45
PATH_SEP
RPAREN
RBRACKET

One 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 ')'.

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions