Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
menhir
Commits
e4d72f52
Commit
e4d72f52
authored
Dec 15, 2014
by
POTTIER Francois
Browse files
More consistent output of failures in bench/good/Makefile.
parent
93abe70d
Changes
3
Hide whitespace changes
Inline
Side-by-side
bench/good/.gitignore
View file @
e4d72f52
...
...
@@ -3,3 +3,5 @@
*.result
*.automaton
*.conflicts
failures
warnings
bench/good/Makefile
View file @
e4d72f52
...
...
@@ -20,9 +20,13 @@ TESTS=$(shell ls | egrep '*([1]|[^2-9]).mly')
RESULTS
=
$(TESTS:.mly=.result)
test
:
clean $(RESULTS)
@
if
test
-e
failed_files
;
then
\
echo
FAILED ON:
;
\
cat
failed_files
;
\
@
if
test
-e
warnings
;
then
\
echo
WARNINGS:
;
\
cat
warnings
;
\
fi
@
if
test
-e
failures
;
then
\
echo
FAILURES:
;
\
cat
failures
;
\
exit
1
;
\
fi
...
...
@@ -48,15 +52,16 @@ test: clean $(RESULTS)
if
$(MENHIR)
$$
CMD
>
& /dev/null
;
then
\
echo
"[OK]
$$
FILES"
;
\
else
\
echo
"-> [KO] menhir failed on
$$
FILES"
;
\
export
FAILED_FILES
=
"
$$
FAILED_FILES
$$
FILES"
;
\
echo
"-> [KO]
$$
FILES:"
|
tee
-a
failures
;
\
echo
" menhir --only-preprocess succeeded,"
|
tee
-a
failures
;
\
echo
" but menhir failed."
|
tee
-a
failures
;
\
fi
;
\
else
\
echo
"-> [KO]
menhir front-end failed on
$$
FILES"
;
\
echo
"
$$
FILES"
>>
failed_files
;
\
echo
"-> [KO]
$$
FILES:"
|
tee
-a
failures
;
\
echo
"
menhir --only-preprocess produced unexpected output."
;
\
fi
;
\
else
\
echo
"Warning: missing file
$*
.expected"
;
\
echo
"Warning: missing file
:
$*
.expected"
|
tee
-a
warnings
;
\
fi
;
\
expected
:
...
...
@@ -68,5 +73,5 @@ expected:
@
echo
"Expected output re-generated."
clean
:
rm
-f
*
.ml
*
.mli
*
.conflicts
*
.automaton
*
.cmi
*
.cmo
*
.cmx
*
.o
*
.s
*
.result
*
~ fail
ed_file
s
rm
-f
*
.ml
*
.mli
*
.conflicts
*
.automaton
*
.cmi
*
.cmo
*
.cmx
*
.o
*
.s
*
.result
*
~ fail
ures warning
s
bench/good/c_unambiguous.expected
0 → 100644
View file @
e4d72f52
%start translation_unit_file
%token XOR_ASSIGN
%token WHILE
%token VOLATILE
%token VOID
%token UNSIGNED
%token UNION
%token TYPE_NAME
%token TYPEDEF
%token TILDE
%token SWITCH
%token SUB_ASSIGN
%token STRUCT
%token STRING_LITERAL
%token STATIC
%token STAR
%token SLASH
%token SIZEOF
%token SIGNED
%token SHORT
%token SEMICOLON
%token RPAREN
%token RIGHT_OP
%token RIGHT_ASSIGN
%token RETURN
%token REGISTER
%token RBRACK
%token RBRACE
%token QUESTION
%token PTR_OP
%token PLUS
%token PERCENT
%token OR_OP
%token OR_ASSIGN
%token NE_OP
%token MUL_ASSIGN
%token MOD_ASSIGN
%token MINUS
%token LT
%token LPAREN
%token LONG
%token LE_OP
%token LEFT_OP
%token LEFT_ASSIGN
%token LBRACK
%token LBRACE
%token INT
%token INC_OP
%token IF
%token IDENTIFIER
%token HAT
%token GT
%token GOTO
%token GE_OP
%token FOR
%token FLOAT
%token EXTERN
%token EQ_OP
%token EQUAL
%token EOF
%token ENUM
%token ELSE
%token ELLIPSIS
%token DOUBLE
%token DOT
%token DO
%token DIV_ASSIGN
%token DEFAULT
%token DEC_OP
%token CONTINUE
%token CONSTANT
%token CONST
%token COMMA
%token COLON
%token CHAR
%token CASE
%token BREAK
%token BAR
%token BANG
%token AUTO
%token AND_OP
%token AND_ASSIGN
%token AMPERSAND
%token ADD_ASSIGN
%type <unit> translation_unit_file
%%
primary_expression:
| IDENTIFIER
{}
| CONSTANT
{}
| STRING_LITERAL
{}
| LPAREN expression RPAREN
{}
postfix_expression:
| primary_expression
{}
| postfix_expression LBRACK expression RBRACK
{}
| postfix_expression LPAREN RPAREN
{}
| postfix_expression LPAREN argument_expression_list RPAREN
{}
| postfix_expression DOT IDENTIFIER
{}
| postfix_expression PTR_OP IDENTIFIER
{}
| postfix_expression INC_OP
{}
| postfix_expression DEC_OP
{}
argument_expression_list:
| assignment_expression
{}
| argument_expression_list COMMA assignment_expression
{}
unary_expression:
| postfix_expression
{}
| INC_OP unary_expression
{}
| DEC_OP unary_expression
{}
| unary_operator cast_expression
{}
| SIZEOF unary_expression
{}
| SIZEOF LPAREN type_name RPAREN
{}
unary_operator:
| AMPERSAND
{}
| STAR
{}
| PLUS
{}
| MINUS
{}
| TILDE
{}
| BANG
{}
cast_expression:
| unary_expression
{}
| LPAREN type_name RPAREN cast_expression
{}
multiplicative_expression:
| cast_expression
{}
| multiplicative_expression STAR cast_expression
{}
| multiplicative_expression SLASH cast_expression
{}
| multiplicative_expression PERCENT cast_expression
{}
additive_expression:
| multiplicative_expression
{}
| additive_expression PLUS multiplicative_expression
{}
| additive_expression MINUS multiplicative_expression
{}
shift_expression:
| additive_expression
{}
| shift_expression LEFT_OP additive_expression
{}
| shift_expression RIGHT_OP additive_expression
{}
relational_expression:
| shift_expression
{}
| relational_expression LT shift_expression
{}
| relational_expression GT shift_expression
{}
| relational_expression LE_OP shift_expression
{}
| relational_expression GE_OP shift_expression
{}
equality_expression:
| relational_expression
{}
| equality_expression EQ_OP relational_expression
{}
| equality_expression NE_OP relational_expression
{}
and_expression:
| equality_expression
{}
| and_expression AMPERSAND equality_expression
{}
exclusive_or_expression:
| and_expression
{}
| exclusive_or_expression HAT and_expression
{}
inclusive_or_expression:
| exclusive_or_expression
{}
| inclusive_or_expression BAR exclusive_or_expression
{}
logical_and_expression:
| inclusive_or_expression
{}
| logical_and_expression AND_OP inclusive_or_expression
{}
logical_or_expression:
| logical_and_expression
{}
| logical_or_expression OR_OP logical_and_expression
{}
conditional_expression:
| logical_or_expression
{}
| logical_or_expression QUESTION expression COLON conditional_expression
{}
assignment_expression:
| conditional_expression
{}
| unary_expression assignment_operator assignment_expression
{}
assignment_operator:
| EQUAL
{}
| MUL_ASSIGN
{}
| DIV_ASSIGN
{}
| MOD_ASSIGN
{}
| ADD_ASSIGN
{}
| SUB_ASSIGN
{}
| LEFT_ASSIGN
{}
| RIGHT_ASSIGN
{}
| AND_ASSIGN
{}
| XOR_ASSIGN
{}
| OR_ASSIGN
{}
expression:
| assignment_expression
{}
| expression COMMA assignment_expression
{}
constant_expression:
| conditional_expression
{}
declaration:
| declaration_specifiers SEMICOLON
{}
| declaration_specifiers init_declarator_list SEMICOLON
{}
declaration_specifiers:
| storage_class_specifier
{}
| storage_class_specifier declaration_specifiers
{}
| type_specifier
{}
| type_specifier declaration_specifiers
{}
| type_qualifier
{}
| type_qualifier declaration_specifiers
{}
init_declarator_list:
| init_declarator
{}
| init_declarator_list COMMA init_declarator
{}
init_declarator:
| declarator
{}
| declarator EQUAL c_initializer
{}
storage_class_specifier:
| TYPEDEF
{}
| EXTERN
{}
| STATIC
{}
| AUTO
{}
| REGISTER
{}
type_specifier:
| VOID
{}
| CHAR
{}
| SHORT
{}
| INT
{}
| LONG
{}
| FLOAT
{}
| DOUBLE
{}
| SIGNED
{}
| UNSIGNED
{}
| struct_or_union_specifier
{}
| enum_specifier
{}
| TYPE_NAME
{}
struct_or_union_specifier:
| struct_or_union IDENTIFIER LBRACE struct_declaration_list RBRACE
{}
| struct_or_union LBRACE struct_declaration_list RBRACE
{}
| struct_or_union IDENTIFIER
{}
struct_or_union:
| STRUCT
{}
| UNION
{}
struct_declaration_list:
| struct_declaration
{}
| struct_declaration_list struct_declaration
{}
struct_declaration:
| specifier_qualifier_list struct_declarator_list SEMICOLON
{}
specifier_qualifier_list:
| type_specifier specifier_qualifier_list
{}
| type_specifier
{}
| type_qualifier specifier_qualifier_list
{}
| type_qualifier
{}
struct_declarator_list:
| struct_declarator
{}
| struct_declarator_list COMMA struct_declarator
{}
struct_declarator:
| declarator
{}
| COLON constant_expression
{}
| declarator COLON constant_expression
{}
enum_specifier:
| ENUM LBRACE enumerator_list RBRACE
{}
| ENUM IDENTIFIER LBRACE enumerator_list RBRACE
{}
| ENUM IDENTIFIER
{}
enumerator_list:
| enumerator
{}
| enumerator_list COMMA enumerator
{}
enumerator:
| IDENTIFIER
{}
| IDENTIFIER EQUAL constant_expression
{}
type_qualifier:
| CONST
{}
| VOLATILE
{}
declarator:
| pointer direct_declarator
{}
| direct_declarator
{}
direct_declarator:
| IDENTIFIER
{}
| LPAREN declarator RPAREN
{}
| direct_declarator LBRACK constant_expression RBRACK
{}
| direct_declarator LBRACK RBRACK
{}
| direct_declarator LPAREN parameter_type_list RPAREN
{}
| direct_declarator LPAREN identifier_list RPAREN
{}
| direct_declarator LPAREN RPAREN
{}
pointer:
| STAR
{}
| STAR type_qualifier_list
{}
| STAR pointer
{}
| STAR type_qualifier_list pointer
{}
type_qualifier_list:
| type_qualifier
{}
| type_qualifier_list type_qualifier
{}
parameter_type_list:
| parameter_list
{}
| parameter_list COMMA ELLIPSIS
{}
parameter_list:
| parameter_declaration
{}
| parameter_list COMMA parameter_declaration
{}
parameter_declaration:
| declaration_specifiers declarator
{}
| declaration_specifiers abstract_declarator
{}
| declaration_specifiers
{}
identifier_list:
| IDENTIFIER
{}
| identifier_list COMMA IDENTIFIER
{}
type_name:
| specifier_qualifier_list
{}
| specifier_qualifier_list abstract_declarator
{}
abstract_declarator:
| pointer
{}
| direct_abstract_declarator
{}
| pointer direct_abstract_declarator
{}
direct_abstract_declarator:
| LPAREN abstract_declarator RPAREN
{}
| LBRACK RBRACK
{}
| LBRACK constant_expression RBRACK
{}
| direct_abstract_declarator LBRACK RBRACK
{}
| direct_abstract_declarator LBRACK constant_expression RBRACK
{}
| LPAREN RPAREN
{}
| LPAREN parameter_type_list RPAREN
{}
| direct_abstract_declarator LPAREN RPAREN
{}
| direct_abstract_declarator LPAREN parameter_type_list RPAREN
{}
c_initializer:
| assignment_expression
{}
| LBRACE c_initializer_list RBRACE
{}
| LBRACE c_initializer_list COMMA RBRACE
{}
c_initializer_list:
| c_initializer
{}
| c_initializer_list COMMA c_initializer
{}
statement_dangerous:
| labeled_statement_statement_dangerous_
{}
| compound_statement
{}
| expression_statement
{}
| selection_statement_dangerous
{}
| iteration_statement_statement_dangerous_
{}
| jump_statement
{}
statement_safe:
| labeled_statement_statement_safe_
{}
| compound_statement
{}
| expression_statement
{}
| selection_statement_safe
{}
| iteration_statement_statement_safe_
{}
| jump_statement
{}
labeled_statement_statement_safe_:
| IDENTIFIER COLON statement_safe
{}
| CASE constant_expression COLON statement_safe
{}
| DEFAULT COLON statement_safe
{}
labeled_statement_statement_dangerous_:
| IDENTIFIER COLON statement_dangerous
{}
| CASE constant_expression COLON statement_dangerous
{}
| DEFAULT COLON statement_dangerous
{}
compound_statement:
| LBRACE RBRACE
{}
| LBRACE statement_list RBRACE
{}
| LBRACE declaration_list RBRACE
{}
| LBRACE declaration_list statement_list RBRACE
{}
declaration_list:
| declaration
{}
| declaration_list declaration
{}
statement_list:
| statement_dangerous
{}
| statement_list statement_dangerous
{}
expression_statement: