module Rasti module DB module NQL grammar Syntax rule sentence space* proposition:proposition space* end rule proposition disjunction / conjunction / statement end rule disjunction left:(conjunction / statement) space* '|' space* right:proposition end rule conjunction left:statement space* '&' space* right:(conjunction / statement) end rule statement parenthesis_sentence / comparison end rule parenthesis_sentence '(' sentence ')' end rule comparison comparison_not_include / comparison_include / comparison_like / comparison_greater_than_or_equal / comparison_less_than_or_equal / comparison_greater_than / comparison_less_than / comparison_not_equal / comparison_equal end rule field _tables:(table:field_name '.')* _column:field_name end rule comparison_include field:field space* comparator:':' space* argument:basic end rule comparison_not_include field:field space* comparator:'!:' space* argument:basic end rule comparison_like field:field space* comparator:'~' space* argument:basic end rule comparison_greater_than field:field space* comparator:'>' space* argument:basic end rule comparison_greater_than_or_equal field:field space* comparator:'>=' space* argument:basic end rule comparison_less_than field:field space* comparator:'<' space* argument:basic end rule comparison_less_than_or_equal field:field space* comparator:'<=' space* argument:basic end rule comparison_not_equal field:field space* comparator:'!=' space* argument:basic end rule comparison_equal field:field space* comparator:'=' space* argument:basic end rule basic boolean / time / float / integer / literal_string / string end rule space [\s\t\n] end rule field_name [a-z_]+ end rule time date:(value:date 'T')? hour:(digit digit) ':' minutes:(digit digit) seconds:(':' value:(digit digit))? timezone:(value:timezone)? end rule date year:(digit digit digit digit) '-' month:(digit digit) '-' day:(digit digit) end rule timezone sign:sign hour:(digit digit) ':' minutes:(digit digit) end rule sign '+' / '-' end rule literal_string '"' string:any_character+ '"' end rule string valid_character+ end rule any_character valid_character / reserved_character end rule valid_character [0-9a-zA-ZÁÀÄÂÃÅĀĂǍáàäâãåāăǎÉÈËÊĒĔĖĚéèëêēĕėěÍÌÏÎĨĬǏíìïîĩĭǐÓÒÖÔÕŌŎŐǑóòöôõōŏőǒÚÙÜÛŨŪŬŮŰǓúùüûũūŭůűǔÑñçÇ%@#+-_'?!$*/\s] end rule boolean true / false end rule true 'true' end rule false 'false' end rule float digit+ '.' digit+ end rule integer digit+ end rule digit [0-9] end rule reserved_character [&|.():!=<>~] end end end end end