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
bef064c7
Commit
bef064c7
authored
Dec 11, 2014
by
POTTIER Francois
Browse files
Changed [Array.create] to [Array.make] everywhere.
parent
cf27e30a
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/grammar.ml
View file @
bef064c7
...
...
@@ -691,10 +691,10 @@ end
The forward reference graph is unused but can be printed on demand. *)
let
forward
:
NonterminalSet
.
t
array
=
Array
.
creat
e
Nonterminal
.
n
NonterminalSet
.
empty
Array
.
mak
e
Nonterminal
.
n
NonterminalSet
.
empty
let
backward
:
NonterminalSet
.
t
array
=
Array
.
creat
e
Nonterminal
.
n
NonterminalSet
.
empty
Array
.
mak
e
Nonterminal
.
n
NonterminalSet
.
empty
let
()
=
Array
.
iter
(
fun
(
nt1
,
rhs
)
->
...
...
@@ -881,10 +881,10 @@ let follow : TerminalSet.t array Lazy.t =
Array
.
make
Nonterminal
.
n
TerminalSet
.
empty
and
forward
:
NonterminalSet
.
t
array
=
Array
.
creat
e
Nonterminal
.
n
NonterminalSet
.
empty
Array
.
mak
e
Nonterminal
.
n
NonterminalSet
.
empty
and
backward
:
NonterminalSet
.
t
array
=
Array
.
creat
e
Nonterminal
.
n
NonterminalSet
.
empty
Array
.
mak
e
Nonterminal
.
n
NonterminalSet
.
empty
in
...
...
src/invariant.ml
View file @
bef064c7
...
...
@@ -29,7 +29,7 @@ module C = Conflict (* artificial dependency; ensures that [Conflict] runs first
let
stack_symbols
:
Lr0
.
node
->
Symbol
.
t
array
=
let
dummy
=
Array
.
creat
e
0
(
Symbol
.
T
Terminal
.
sharp
)
Array
.
mak
e
0
(
Symbol
.
T
Terminal
.
sharp
)
in
Misc
.
tabulate
Lr0
.
n
(
fun
node
->
Item
.
Set
.
fold
(
fun
item
accu
->
...
...
src/item.ml
View file @
bef064c7
...
...
@@ -142,7 +142,7 @@ module Closure (L : Lookahead.S) = struct
ref
0
let
mapping
:
node
array
array
=
Array
.
creat
e
Production
.
n
[
||
]
Array
.
mak
e
Production
.
n
[
||
]
let
item2node
item
=
let
prod
,
pos
=
export
item
in
...
...
src/lr0.ml
View file @
bef064c7
...
...
@@ -173,7 +173,7 @@ let rec explore (state : Item.Set.t) : node =
InfiniteArray
.
set
_transitions
k
(
SymbolMap
.
map
(
fun
symbolic_state
->
let
(
k
:
node
)
=
explore
(
Item
.
Map
.
domain
symbolic_state
)
in
let
lookahead
:
SymbolicLookahead
.
t
array
=
Array
.
creat
e
(
Item
.
Map
.
cardinal
symbolic_state
)
SymbolicLookahead
.
empty
in
Array
.
mak
e
(
Item
.
Map
.
cardinal
symbolic_state
)
SymbolicLookahead
.
empty
in
let
(
_
:
int
)
=
Item
.
Map
.
fold
(
fun
_
s
i
->
lookahead
.
(
i
)
<-
s
;
i
+
1
...
...
src/lr1.ml
View file @
bef064c7
...
...
@@ -227,7 +227,7 @@ let queue : node Queue.t =
newly found state. *)
let
map
:
node
list
array
=
Array
.
creat
e
Lr0
.
n
[]
Array
.
mak
e
Lr0
.
n
[]
(* A counter that allows assigning raw numbers to nodes. *)
...
...
src/lr1partial.ml
View file @
bef064c7
...
...
@@ -60,7 +60,7 @@ end) = struct
(* Mapping of LR(0) state numbers to lists of nodes. *)
let
map
:
node
list
array
=
Array
.
creat
e
Lr0
.
n
[]
Array
.
mak
e
Lr0
.
n
[]
(* Exploring a state. This creates a new node, if necessary, and
enqueues it for further exploration. *)
...
...
src/misc.ml
View file @
bef064c7
...
...
@@ -37,7 +37,7 @@ let tabulateb n f =
)
0
a
let
tabulatef
number
fold
n
dummy
f
=
let
a
=
Array
.
creat
e
n
dummy
in
let
a
=
Array
.
mak
e
n
dummy
in
let
()
=
fold
(
fun
()
element
->
a
.
(
number
element
)
<-
f
element
)
()
in
...
...
@@ -105,7 +105,7 @@ let separated_list_to_string printer separator list =
let
index_map
string_map
=
let
n
=
StringMap
.
cardinal
string_map
in
let
a
=
Array
.
creat
e
n
None
in
let
a
=
Array
.
mak
e
n
None
in
let
conv
,
_
=
StringMap
.
fold
(
fun
k
v
(
conv
,
idx
)
->
a
.
(
idx
)
<-
Some
(
k
,
v
);
...
...
src/parameterizedGrammar.ml
View file @
bef064c7
...
...
@@ -330,7 +330,7 @@ let check_grammar p_grammar =
n with n > 0 is the number of parameters of the clique.
*)
let
unseen
=
-
1
in
let
marked_components
=
Array
.
creat
e
n
unseen
in
let
marked_components
=
Array
.
mak
e
n
unseen
in
let
flexible_arrow
args
=
let
ty
=
Arrow
(
List
.
map
(
fun
_
->
fresh_flexible_variable
()
)
args
)
in
...
...
src/tarjan.ml
View file @
bef064c7
...
...
@@ -67,7 +67,7 @@ end) = struct
[data option], because we have no meaningful initial value of
type [data] at hand. *)
let
table
=
Array
.
creat
e
G
.
n
None
in
let
table
=
Array
.
mak
e
G
.
n
None
in
(* Initialize the array. *)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment