Relative Content

Tag Archive for parsingodataantlrantlr4

OData Parser, Problem with Substring function

i am writing an OData parser and I am struggling with the substring function.
I want to parse the query ‘substring(Location_Code, 5) eq 10’, but he throws an error by number 5 inside the substring function. The problem is the lexerfunction ‘SUBSTRING LBR PROPERTY KMA INT RBR’, because if I change INT to VALUE it works. But the substring function accepts only in the terms of the odata definition integer values. Does someone know what I am doing wrong?

ANTLR – Odata Grammar doesnt work with double quote

i am actually writing a parser for OData and I am trying to get it running with the test input ‘{“Number”:”Four”}’. But he can’t parse it. When I replace line : ‘”‘ ALLOWED_CHARACTERS ‘”‘ with : ”’ ALLOWED_CHARACTERS ”’, I can correctly parse the input ‘{‘Number’:”Four”}’. So I think there is a problem with the double quotes (“). I tried also to replace PROPERTY with VALUE, but this doesn’t work, too. Does anybody knows what I am doing wrong?