Sha256: ad5931ff14bf1bbfcef1ed6076437ce3c950892970f3beb3550df0511e1ce72d

Contents?: true

Size: 470 Bytes

Versions: 2

Compression:

Stored size: 470 Bytes

Contents

grammar SimpleLogic
  rule expression
    infix_operation / primary
  end

  rule infix_operation
    lhs:infix_operation_chain rhs:primary <InfixOperation>
  end

  rule infix_operation_chain
    (primary space operator space)+ <InfixOperationChain>
  end

  rule space
    " "*
  end

  rule operator
    "&&" / "||"
  end

  rule primary
    variable / "!" primary <NegationOperator> / '(' expression ')'
  end

  rule variable
    name:[\w]+ <Variable>
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_logic-0.0.2 lib/simple_logic/simple_logic.treetop
simple_logic-0.0.1 lib/simple_logic/simple_logic.treetop