
(* The type of tokens. *)

type token = 
  | WHILE
  | VOID
  | VECTOR
  | UPPER
  | UNREACHABLE
  | UNITVECTOR
  | TRUNCATE
  | TRANSPOSE
  | TRANSFORMEDPARAMETERSBLOCK
  | TRANSFORMEDDATABLOCK
  | TIMESASSIGN
  | TIMES
  | TILDE
  | TARGET
  | STRINGLITERAL of (string)
  | SIMPLEX
  | SEMICOLON
  | RPAREN
  | ROWVECTOR
  | RETURN
  | REJECT
  | REALNUMERAL of (string)
  | REAL
  | RBRACK
  | RBRACE
  | RABRACK
  | QMARK
  | PROFILE
  | PRINT
  | POSITIVEORDERED
  | PLUSASSIGN
  | PLUS
  | PARAMETERSBLOCK
  | ORDERED
  | OR
  | OFFSET
  | NEQUALS
  | MULTIPLIER
  | MODULO
  | MODELBLOCK
  | MINUSASSIGN
  | MINUS
  | MATRIX
  | LPAREN
  | LOWER
  | LEQ
  | LDIVIDE
  | LBRACK
  | LBRACE
  | LABRACK
  | INTNUMERAL of (string)
  | INT
  | INCREMENTLOGPROB
  | IN
  | IMAGNUMERAL of (string)
  | IF
  | IDIVIDE
  | IDENTIFIER of (string)
  | HAT
  | GETLP
  | GEQ
  | GENERATEDQUANTITIESBLOCK
  | FUNCTIONBLOCK
  | FOR
  | EQUALS
  | EOF
  | ELTTIMESASSIGN
  | ELTTIMES
  | ELTPOW
  | ELTDIVIDEASSIGN
  | ELTDIVIDE
  | ELSE
  | DIVIDEASSIGN
  | DIVIDE
  | DATABLOCK
  | COVMATRIX
  | CORRMATRIX
  | CONTINUE
  | COMPLEXVECTOR
  | COMPLEXROWVECTOR
  | COMPLEXMATRIX
  | COMPLEX
  | COMMA
  | COLON
  | CHOLESKYFACTORCOV
  | CHOLESKYFACTORCORR
  | BREAK
  | BAR
  | BANG
  | ASSIGN
  | ARROWASSIGN
  | ARRAY
  | AND

(* This exception is raised by the monolithic API functions. *)

exception Error

(* The monolithic API. *)

val program: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (Ast.untyped_program)

val functions_only: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (Ast.untyped_program)

module MenhirInterpreter : sig
  
  (* The incremental API. *)
  
  include MenhirLib.IncrementalEngine.INCREMENTAL_ENGINE
    with type token = token
  
end

(* The entry point(s) to the incremental API. *)

module Incremental : sig
  
  val program: Lexing.position -> (Ast.untyped_program) MenhirInterpreter.checkpoint
  
  val functions_only: Lexing.position -> (Ast.untyped_program) MenhirInterpreter.checkpoint
  
end
