Sha256: 68ec0268820689ac90081ab022b9b523624196f948373d1fa489886282e895e0

Contents?: true

Size: 918 Bytes

Versions: 8

Compression:

Stored size: 918 Bytes

Contents

grammar Tnql
  include Dates
  include Diagnosis
  include EBaseRecords
  include BatchTypes
  include Provider
  include RegistrationStatus
  include Registry
  include Staging
  include Treatment
  include TumourType
  include Patient
  include VitalStatus
  include Age

  # The root grammar
  rule query
    quantity:record_count? pre:preconditions* tumours_keyword post:additional_conditions*
  end

  rule word_break
    !(!(' '/',') .)
  end

  rule space
    ' '+
  end

  rule number
    [0-9]+
  end

  rule record_count
    all_keyword
    /
    'first' space number <Nodes::RecordCountNode>
  end

  rule all_keyword
     'all' word_break
  end

  rule tumours_keyword
     space 'tumours' word_break
  end

  rule preconditions
    registration_status / registry / behaviour / stage / tumour_type
  end

  rule additional_conditions
    diagnosis / treatment / with_clause / for_patients_clause
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tnql-1.1.2 lib/tnql/grammars/main.treetop
tnql-1.1.1 lib/tnql/grammars/main.treetop
tnql-1.1.0 lib/tnql/grammars/main.treetop
tnql-1.0.4 lib/tnql/grammars/main.treetop
tnql-1.0.3 lib/tnql/grammars/main.treetop
tnql-1.0.2 lib/tnql/grammars/main.treetop
tnql-1.0.1 lib/tnql/grammars/main.treetop
tnql-1.0.0 lib/tnql/grammars/main.treetop