Sha256: 417435c645b4287fef3151981ccbcd759dd09ab0a4e348f27dd7a7256909c4fb

Contents?: true

Size: 1.29 KB

Versions: 6

Compression:

Stored size: 1.29 KB

Contents

module Pione
  module Lang
    # ContextParser is a set of parsers for PIONE contexts.
    module ContextParser
      include Parslet

      #
      # structural context
      #
      rule(:structural_context_element) { declaration | conditional_branch }
      rule(:structural_context) {(structural_context_element | empty_line).repeat}

      # +conditional_branch_context+ matches conditional branch contexts.
      rule(:conditional_branch_context) {structural_context.as(:conditional_branch_context)}

      # +param_context+ matches parameter block contexts.
      rule(:param_context) {structural_context.as(:param_context)}

      # +rule_condition_context+ matches rule condition contexts.
      rule(:rule_condition_context) {structural_context.as(:rule_condition_context)}

      # +flow_context+ matches flow contexts.
      rule(:flow_context) {structural_context.as(:flow_context)}

      # +package_context+ matches package contexts.
      rule(:package_context) {structural_context.as(:package_context)}

      #
      # literal context
      #

      # +literal_context+ matches any character sequences.
      rule(:literal_context) { (keyword_End.absent? >> any).repeat }

      # +action_conte+ matches action contexts.
      rule(:action_context) { literal_context.as(:action_context) }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pione-0.4.2 lib/pione/lang/context-parser.rb
pione-0.4.1 lib/pione/lang/context-parser.rb
pione-0.4.0 lib/pione/lang/context-parser.rb
pione-0.3.2 lib/pione/lang/context-parser.rb
pione-0.3.1 lib/pione/lang/context-parser.rb
pione-0.3.0 lib/pione/lang/context-parser.rb