Sha256: 91bdad106b18080fed3486b5eb9a944435c28ad7e8ae6ced3d8ff0cbe840863a

Contents?: true

Size: 715 Bytes

Versions: 2

Compression:

Stored size: 715 Bytes

Contents

grammar Expressive

  rule program
    statement* <Program>
  end

  rule statement
    whitespace* (list / atom) whitespace* <Statement>
  end

  rule atom
    (value / identifier)
  end

  rule list
    '(' statement+ ')' <List>
  end

  rule value
    (boolean / number)
  end

  rule word
    [a-zA-Z]+
  end

  rule number
    ( float / integer )
  end

  rule integer
    [0-9]+ <IntegerValue>
  end

  rule float
    [0-9]+ ('.' [0-9]+) <FloatValue>
  end

  rule whitespace
    [\n\r\s\t]
  end

  rule parenthesis
    [\(\)\[\]]
  end

  rule boolean
    ('true' / 'false') <Boolean>
  end

  rule delimeter
    parenthesis / whitespace
  end

  rule identifier
    (!delimeter .)+ <Identifier>
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
expressive-0.0.2 lib/expressive_grammar.treetop
expressive-0.0.1 lib/expressive_grammar.treetop