Skip to content

Commit

Permalink
Start work on Hmc.Grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Evans committed Sep 29, 2024
1 parent 84e1578 commit ac3fba6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bootstrap/src/hmc/Grammar.hmh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
open Basis
open! Basis.Rudiments

type token_and = {source: Source.Slice.t}

include hocc
token AND "and" of token_and

start S ::= epsilon
6 changes: 6 additions & 0 deletions bootstrap/src/hmc/Grammar.hmhi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
open Basis
open! Basis.Rudiments

type token_and = {source: Source.Slice.t}

include hocc
10 changes: 10 additions & 0 deletions bootstrap/src/hmc/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@
(libraries Basis)
(synopsis "Hemlock bootstrap compiler library")
)

; This rule calls an out-of-tree `hocc`, because the in-tree one depends on `Hmc`.
(rule
(deps
(glob_files Grammar.hmh*))
(targets Grammar.mli Grammar.ml)
(action
(with-accepted-exit-codes
(or 0 1)
(system "hocc -v -a ielr1 -ml -s Grammar"))))

0 comments on commit ac3fba6

Please sign in to comment.