-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
234 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
%option noinput nounput noyywrap never-interactive bison-bridge bison-locations | ||
|
||
%{ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include "bison-generated.h" | ||
#include "bison-generated-lexer.h" | ||
|
||
%} | ||
|
||
%% | ||
|
||
|
||
[abc] { | ||
return yytext[0]; | ||
} | ||
|
||
[\n|\r\n] { | ||
return(YYEOF); | ||
} | ||
|
||
[[:space:]] {} | ||
|
||
<<EOF>> { | ||
return(YYEOF); | ||
} | ||
|
||
. { | ||
fprintf(stderr, "Illegal character '%s'\n", yytext); | ||
return(YYEOF); | ||
} | ||
|
||
%% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,6 @@ | ||
RSpec.describe Lrama::State do | ||
let(:grammar) { <<-FILE } | ||
%union { | ||
int val; | ||
} | ||
%token a | ||
%token b | ||
%token c | ||
%define lr.type ielr | ||
%% | ||
S: a A B a | ||
| b A B b | ||
A: a C D E | ||
B: c | ||
| // empty | ||
C: D | ||
D: a | ||
E: a | ||
| // empty | ||
%% | ||
FILE | ||
|
||
|
||
describe '#internal_dependencies' do | ||
subject { state.internal_dependencies(*goto) } | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters