Commit 59cbe66a authored by POTTIER Francois's avatar POTTIER Francois

Merge branch 'master' into coverage

Conflicts:
	TODO
	src/settings.ml
	src/settings.mli
parents 46a2fb64 185d8b0c
2015/09/21:
Re-established some error messages concerning the mis-use of $i which
had disappeared on 2015/06/29.
2015/09/11:
Fixed the mysterious message that would appear when a nonterminal symbol
begins with an uppercase letter and --infer is turned on. Clarified the
documentation to indicate that a (non-start) nonterminal symbol can begin
with an uppercase letter, but this is not recommended.
2015/08/27:
New option --inspection (added last January, documented only now). This
generates an inspection API which allows inspecting the automaton's stack,
among other things. This API can in principle be used to write custom code
for error reporting, error recovery, etc. It is not yet mature and may
change in the future.
2015/07/20:
Added the command line options --unused-token <symbol> and --unused-tokens.
2015/06/29:
Changed the treatment of the positional keywords $i. They are now
rewritten into variables of the form '_i' where 'i' is an integer.
......
......@@ -6,7 +6,7 @@
SHELL := bash
.PHONY: all test clean package check export godi
.PHONY: all test clean package check export godi opam
# -------------------------------------------------------------------------
......@@ -96,10 +96,12 @@ LIBFILES := \
package: clean
# Create a directory to store the distributed files temporarily.
# In src/_tags, every line tagged "my_warnings" is removed.
@ rm -fr $(PACKAGE)
@ mkdir -p $(PACKAGE)/src
@ cp -fr $(DISTRIBUTED_FILES) $(PACKAGE)
@ cp -fr src/*.ml{,i,y,l,pack} src/Makefile src/_tags src/META $(PACKAGE)/src
@ cp -fr src/*.ml{,i,y,l,pack} src/Makefile src/META $(PACKAGE)/src
@ grep -v my_warnings src/_tags > $(PACKAGE)/src/_tags
@ $(MAKE) -C $(PACKAGE)/demos clean
# Insert headers.
@ echo "-> Inserting headers."
......@@ -154,7 +156,7 @@ check:
RSYNC := scp -p -C
TARGET := yquem.inria.fr:public_html/menhir/
PAGE := /home/fpottier/dev/page
API := convert.mli.html IncrementalEngine.ml.html
API := convert.mli.html IncrementalEngine.ml.html general.mli.html
export:
# Copier l'archive et la doc vers yquem.
......@@ -217,3 +219,38 @@ godi:
(*) \
open $(GODIURL) ;; \
esac
# -------------------------------------------------------------------------
# Updating the opam package.
# This entry assumes that "make package" and "make export" have been
# run on the same day.
OPAM := $(HOME)/dev/opam-repository
CSUM = $(shell md5sum menhir-$(DATE).tar.gz | cut -d ' ' -f 1)
opam:
# Update my local copy of the opam repository.
@ echo "Updating local opam repository..."
@ cd $(OPAM) && \
git fetch upstream && \
git merge upstream/master
# Create a new Menhir package, based on the last one.
@ echo "Creating a new package description menhir-$(DATE)..."
@ cd $(OPAM)/packages/menhir && \
cp -r `ls | grep menhir | tail -1` menhir.$(DATE)
# Update the file "url".
@ cd $(OPAM)/packages/menhir/menhir.$(DATE) && \
rm url && \
echo 'archive: "http://gallium.inria.fr/~fpottier/menhir/menhir-$(DATE).tar.gz"' >> url && \
echo 'checksum: "$(CSUM)"' >> url
# Prepare a commit.
@ echo "Preparing a new commit..."
@ cd $(OPAM)/packages/menhir && \
git add menhir.$(DATE) && \
git status
# Ask for review.
@ echo "If happy, please run:"
@ echo " cd $(OPAM)/packages/menhir && git commit -a && git push && firefox https://github.com/"
@ echo "and issue a pull request."
This diff is collapsed.
......@@ -11,7 +11,7 @@ MENHIR=$(SRC)/_stage2/menhir.native --stdlib $(SRC)
# La convention de nommage des tests multi-grammaires
# est : /nom/-[1-9].mly
TESTS=$(shell ls *.mly | egrep '*([1]|[^2-9]).mly')
TESTS=$(shell ls *.mly | egrep '.*([1]|[^2-9]).mly')
RESULTS=$(TESTS:.mly=.result)
test: clean $(RESULTS)
......@@ -21,6 +21,7 @@ test: clean $(RESULTS)
fi
%.result: %.mly
# Check if there is a group of several .mly files, or just one .mly file.
@ if echo $< | grep -e "-1.mly" &> /dev/null; then \
export BASE=`echo $< | sed s/"-1.mly"/""/`; \
export FILES=`echo $$BASE-[1-9].mly`; \
......@@ -33,7 +34,7 @@ test: clean $(RESULTS)
echo "-> [KO] menhir should not accept $$FILES"; \
export FAILED_FILES="$$FAILED_FILES $$FILES"; \
else \
$(SHELL) -c '$(MENHIR) --only-preprocess $$CMD >& $@'; \
$(SHELL) -c '$(MENHIR) $$CMD >& $@'; \
if [ x$$CREATE_EXPECTED == x"1" ]; then \
cp $@ $*.expected; \
fi; \
......
%start a
%type <unit> a
%%
a:
| b
{ () }
b:
| a
{ () }
%%
File "epsilon-cycle.mly", line 8, characters 2-4:
File "epsilon-cycle.mly", line 11, characters 2-4:
Error: the grammar is ambiguous.
The following items participate in an epsilon-cycle:
a -> . b
b -> . a
%start a
%type <unit> a
%token B
%%
a:
b { () }
b | B { () }
b:
a { () }
......
File "inline-shift.mly", line 5, characters 3-11:
Error: You cannot use b and the $i syntax in this branch since the definition of b has to be inlined.
File "inlined-dollar.mly", line 9, characters 8-9:
Error: You cannot use $i syntax in this branch since its definition will be inlined.
%start s
%type <unit> s
%%
s:
| s
{}
%%
Error: no tokens have been declared.
File "option.mly", line 6, characters 0-6:
File "../../src/standard.mly", line 13, characters 8-14:
File "../../src/standard.mly", line 85, characters 8-14:
Error: symbol option is defined with arities 0 and 1.
File "positional-identifier-clash.mly", line 4, characters 6-8:
Error: there are multiple producers named _1 in this sequence.
%start<unit> s
%token<unit> A
%%
s : A _1=A {}
......@@ -21,7 +21,7 @@ list___anonymous_1_:
{let x =
let y = y0 in
let x = x0 in
( ( x + y ))
( x + y )
in
( x :: xs )}
......@@ -31,19 +31,19 @@ list___anonymous_0_:
| x0 = A xs = list___anonymous_0_
{let x =
let x = x0 in
( ( x ))
( x )
in
( x :: xs )}
| x0 = B xs = list___anonymous_0_
{let x =
let x = x0 in
( ( x ))
( x )
in
( x :: xs )}
| x0 = C xs = list___anonymous_0_
{let x =
let x = x0 in
( ( x ))
( x )
in
( x :: xs )}
......
......@@ -20,7 +20,7 @@ clauses:
| xs0 = loption_separated_nonempty_list_DOT_clause__ _2 = EOF
{let clauses =
let xs = xs0 in
( ( xs ))
( xs )
in
( clauses )}
......@@ -41,9 +41,9 @@ params:
let _1 = _10 in
let x =
let xs = xs0 in
( ( xs ))
( xs )
in
( ( x ))
( x )
in
( terms )}
......@@ -81,7 +81,7 @@ clause:
| tm = term _2 = INFERS xs0 = loption_separated_nonempty_list_COMMA_term__
{let ts =
let xs = xs0 in
( ( xs ))
( xs )
in
( (tm, ts) )}
| fact = term
......
......@@ -29,9 +29,9 @@ expr:
let _10 = _100 in
let x =
let _1 = _10 in
( ( (+) ))
( (+) )
in
( ( x ))
( x )
in
( op e1 e2 )}
| e1 = expr _100 = MINUS e2 = expr
......@@ -39,9 +39,9 @@ in
let _10 = _100 in
let x =
let _1 = _10 in
( ( (-) ))
( (-) )
in
( ( x ))
( x )
in
( op e1 e2 )}
| e1 = expr _100 = TIMES e2 = expr
......@@ -49,9 +49,9 @@ in
let _10 = _100 in
let x =
let _1 = _10 in
( ( ( * ) ))
( ( * ) )
in
( ( x ))
( x )
in
( op e1 e2 )}
| e1 = expr _100 = DIV e2 = expr
......@@ -59,9 +59,9 @@ in
let _10 = _100 in
let x =
let _1 = _10 in
( ( (/) ))
( (/) )
in
( ( x ))
( x )
in
( op e1 e2 )}
| _1 = MINUS e = expr %prec UMINUS
......
......@@ -137,7 +137,7 @@ definitiveIdentifier:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -172,7 +172,7 @@ tagDefault:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -181,7 +181,7 @@ extensionDefault:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -190,7 +190,7 @@ moduleBody:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -201,7 +201,7 @@ exports:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -210,7 +210,7 @@ symbolsExported:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -219,7 +219,7 @@ imports:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -228,7 +228,7 @@ symbolsImported:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -253,7 +253,7 @@ assignedIdentifier:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -568,14 +568,14 @@ optionalExtensionMarker:
{ ()}
|
{let _1 =
( ())
()
in
()}
versionNumber:
|
{let _1 =
( ())
()
in
()}
| _1 = Number _2 = Colon
......@@ -796,7 +796,7 @@ extensionAdditionAlternatives:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -841,7 +841,7 @@ class_x:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -878,7 +878,7 @@ extensionAdditions:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -1173,7 +1173,7 @@ valueConstraint:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -1340,7 +1340,7 @@ exceptionSpec:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -1417,7 +1417,7 @@ includes:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -1466,7 +1466,7 @@ presenceConstraint:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -1614,7 +1614,7 @@ defaultSyntax:
| _1 = LeftBrace xs0 = loption_separated_nonempty_list_Comma_fieldSetting__ _3 = RightBrace
{let _2 =
let xs = xs0 in
( ( xs ))
( xs )
in
()}
......@@ -1740,7 +1740,7 @@ userDefinedConstraint:
| _1 = CONSTRAINED _2 = BY _3 = LeftBrace xs0 = loption_separated_nonempty_list_Comma_userDefinedConstraintParameter__ _5 = RightBrace
{let _4 =
let xs = xs0 in
( ( xs ))
( xs )
in
()}
......@@ -1783,7 +1783,7 @@ level:
{ ()}
|
{let _1 =
( ())
()
in
()}
......
This diff is collapsed.
This diff is collapsed.
......@@ -475,89 +475,89 @@ text_element:
{ ( Documentation.Raw data )}
| _1 = CODE _3 = CLOSE
{let str =
( ( "" ))
( "" )
in
( Documentation.Code str )}
| _1 = CODE data0 = Data _3 = CLOSE
{let str =
let data = data0 in
( ( data))
( data)
in
( Documentation.Code str )}
| _1 = PRECODE _3 = CLOSE
{let str =
( ( "" ))
( "" )
in
( Documentation.PreCode str )}
| _1 = PRECODE data0 = Data _3 = CLOSE
{let str =
let data = data0 in
( ( data))
( data)
in
( Documentation.PreCode str )}
| _1 = VERBATIM _3 = CLOSE
{let str =
( ( "" ))
( "" )
in
( Documentation.Verbatim str )}
| _1 = VERBATIM data0 = Data _3 = CLOSE
{let str =
let data = data0 in
( ( data))
( data)
in
( Documentation.Verbatim str )}
| _1 = BOLD elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.(Style(Bold, text)) )}
| _1 = ITALIC elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.(Style(Italic, text)) )}
| _1 = EMPHASIZE elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.(Style(Emphasize, text)) )}
| _1 = CENTER elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.(Style(Center, text)) )}
| _1 = LEFT elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.(Style(Left, text)) )}
| _1 = RIGHT elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.(Style(Right, text)) )}
| _1 = SUPERSCRIPT elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.(Style(Superscript, text)) )}
| _1 = SUBSCRIPT elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.(Style(Subscript, text)) )}
| tag = Custom elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.(Style(Custom tag, text)) )}
| _1 = LIST i = nonempty_list_item_ _3 = CLOSE
......@@ -569,29 +569,29 @@ in
| level = Title label = option_label_identifier_ elems0 = list_text_element_ _4 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.Title(level, label, text) )}
| _1 = REFERENCE rf = reference _4 = CLOSE
{let text =
( ( None ))
( None )
in
( Documentation.Reference(rf, text) )}
| _1 = REFERENCE rf = reference elems0 = nonempty_list_text_element_ _4 = CLOSE
{let text =
let elems = elems0 in
( ( Some elems ))
( Some elems )
in
( Documentation.Reference(rf, text) )}
| target = Target _3 = CLOSE
{let str =
( ( "" ))
( "" )
in
( Documentation.Target(target, str) )}
| target = Target data0 = Data _3 = CLOSE
{let str =
let data = data0 in
( ( data))
( data)
in
( Documentation.Target(target, str) )}
| _1 = SPECIAL special = special _3 = CLOSE
......@@ -613,7 +613,7 @@ tag:
| _1 = SEE see = see elems0 = list_text_element_ _4 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.See(see, text) )}
| _1 = SINCE data = Data _3 = CLOSE
......@@ -621,37 +621,37 @@ in
| _1 = BEFORE name = name elems0 = list_text_element_ _4 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.Before(name, text) )}
| _1 = DEPRECATED elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.Deprecated text )}
| _1 = PARAM name = name elems0 = list_text_element_ _4 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.Param(name, text) )}
| _1 = RAISE name = name elems0 = list_text_element_ _4 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.Raise(name, text) )}
| _1 = RETURN elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.Return text )}
| _1 = TAG name = name elems0 = list_text_element_ _4 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.Tag(name, text) )}
......@@ -1273,7 +1273,7 @@ item:
| _1 = ITEM elems0 = list_text_element_ _3 = CLOSE
{let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( text )}
......@@ -1309,11 +1309,11 @@ doc:
| _1 = DOC elems0 = list_text_element_ tags0 = list_tag_ _4 = CLOSE
{let tags =
let tags = tags0 in
( ( tags ))
( tags )
in
let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.(Ok {text; tags}) )}
| _1 = DOC err = doc_error _3 = CLOSE
......@@ -1323,11 +1323,11 @@ comment:
| _1 = COMMENT elems0 = list_text_element_ tags0 = list_tag_ _4 = CLOSE
{let tags =
let tags = tags0 in
( ( tags ))
( tags )
in
let text =
let elems = elems0 in
( ( elems ))
( elems )
in
( Documentation.(Documentation (Ok {text; tags})) )}
| _1 = COMMENT err = doc_error _3 = CLOSE
......
......@@ -10,7 +10,7 @@ a:
| _10 = A _2 = c
{let _1 =
let _1 = _10 in
( ())
()
in
()}
......
This diff is collapsed.
This diff is collapsed.
......@@ -15,9 +15,9 @@ a:
let x =
let _2 = _20 in
let x = x0 in
( ( f_c x ))
( f_c x )
in
( ( f_b x ))
( f_b x )
in
let x =
let _2 = _21 in
......@@ -26,9 +26,9 @@ let x =
let x =
let _2 = _20 in
let x = x0 in
( ( f_c x ))
( f_c x )
in
( ( f_b x ))
( f_b x )
in
( f_a x )}
......