Sha256: 4a27eceba95917369842db492cd0f7c9e6f58462f645421b7918460c3020d639

Contents?: true

Size: 568 Bytes

Versions: 6

Compression:

Stored size: 568 Bytes

Contents

%require "~> 0.1"
%generator "ruby"

%define api.push-pull pull
%define panic-mode true
%token <lex> NUMBER
%token <lex> SEMICOLON ";"
%token <lex> ADD "+"
%token <lex> LPAREN "("
%token <lex> RPAREN ")"

%type <node> s e t

%null.data api.prefix "antelope_"
%union {
  struct slip_parser_node* node;
  struct slip_lex_token* lex;
  struct slip_parser_list* list;
}

%%

s: e
e: t[a] SEMICOLON[b] { $$ = $1 }
 | t[a] ADD[b] e[c]  { $$ = $1 + $2 }
 | error[a]

t: NUMBER
 | LPAREN e RPAREN   { $$ = $2 }

%%

class DeterministicParser < Antelope::Parser
  %{write}
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
antelope-0.4.1 examples/deterministic.ace
antelope-0.4.0 examples/deterministic.ace
antelope-0.2.0 examples/deterministic.ace
antelope-0.1.11 examples/deterministic.ace
antelope-0.1.10 examples/deterministic.ace
antelope-0.1.9 examples/deterministic.ace