Project

General

Profile

Revision 17e1d0f4 src/lexer_lustre.mll

View differences:

src/lexer_lustre.mll
24 24
  "state", STATE;
25 25
  "until", UNTIL;
26 26
  "unless", UNLESS;
27
  "last", LAST;
28 27
  "resume", RESUME;
29 28
  "restart", RESTART;
30 29
  "if", IF;
......
42 41
  "returns", RETURNS;
43 42
  "var", VAR;
44 43
  "imported", IMPORTED;
45
  "wcet", WCET;
46 44
  "type", TYPE;
47 45
  "int", TINT;
48 46
  "bool", TBOOL;
......
50 48
  "real", TREAL;
51 49
  "clock", TCLOCK;
52 50
  "not", NOT;
53
  "tail", TAIL;
54 51
  "true", TRUE;
55 52
  "false", FALSE;
56 53
  "and", AND;
......
83 80
    NODESPEC ns
84 81
  with LexerLustreSpec.Error loc -> raise (Parse.Error (Location.shift (Location.curr lexbuf) loc, Parse.Node_spec_error s))
85 82

  
86

  
87
let make_kind_spec lexbuf s =
88
  try 
89
    let s_lexbuf = Lexing.from_string s in
90
    (*Format.printf "KIND SPEC \"%s\"@." s;*)
91
    let contract = KindLustreParser.contract_in_block_main KindLustreLexer.token s_lexbuf in
92
    let dummy_ns = { Lustre_types.requires = []; ensures = []; behaviors = []; spec_loc = Location.dummy_loc} in
93
    begin
94
      List.iter (fun item ->
95
      		Format.eprintf "CONTRACT: %a@." KindLustreAst.pp_print_contract_item item) contract;
96
      NODESPEC dummy_ns
97
    end
98
  with exn -> ((*Printexc.print_backtrace stderr; *) raise exn)
99

  
100
let make_spec = make_kind_spec
101 83
}
102 84

  
103 85
let newline = ('\010' | '\013' | "\013\010")

Also available in: Unified diff