Sha256: f4ed47b3c26909e37f0122089c14f0e9bd5c672d016e9c8f7553f937c3343056

Contents?: true

Size: 1.01 KB

Versions: 7

Compression:

Stored size: 1.01 KB

Contents

grammar Stamina::RegLang::Parser

  rule regexp
    (space* alt:alternative space*)                   <Stamina::RegLang::Regexp>
  end

  rule alternative
    (head:sequence space* '|' space* tail:alternative)   <Stamina::RegLang::Alternative>
  | sequence
  end

  rule sequence
    (head:monadic space+ tail:sequence)             <Stamina::RegLang::Sequence>
  | monadic
  end

  rule monadic
    star | plus | question | term
  end

  rule star
    (term '*')                                          <Stamina::RegLang::Star>
  end

  rule plus
    (term '+')                                          <Stamina::RegLang::Plus>
  end

  rule question
    (term '?')                                      <Stamina::RegLang::Question>
  end

  rule term
    symbol | parenthesized
  end

  rule symbol
    [a-zA-Z0-9$_-]+                                   <Stamina::RegLang::Symbol>
  end

  rule parenthesized
    ('(' space* expr:regexp space* ')')        <Stamina::RegLang::Parenthesized>
  end

  rule space
    [ \t\n]
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stamina-induction-0.6.1 lib/stamina-induction/stamina/reg_lang/parser/parser.citrus
stamina-induction-0.6.0 lib/stamina-induction/stamina/reg_lang/parser/parser.citrus
stamina-induction-0.5.4 lib/stamina-induction/stamina/reg_lang/parser/parser.citrus
stamina-induction-0.5.3 lib/stamina-induction/stamina/reg_lang/parser/parser.citrus
stamina-induction-0.5.2 lib/stamina-induction/stamina/reg_lang/parser/parser.citrus
stamina-induction-0.5.1 lib/stamina-induction/stamina/reg_lang/parser/parser.citrus
stamina-induction-0.5.0 lib/stamina-induction/stamina/reg_lang/parser/parser.citrus