cprover
jsil_language.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Jsil Language
4 
5 Author: Michael Tautschnig, tautschn@amazon.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_JSIL_JSIL_LANGUAGE_H
13 #define CPROVER_JSIL_JSIL_LANGUAGE_H
14 
15 #include <util/language.h>
16 
17 #include "jsil_parse_tree.h"
18 
20 {
21 public:
22  virtual bool preprocess(
23  std::istream &instream,
24  const std::string &path,
25  std::ostream &outstream);
26 
27  virtual bool parse(
28  std::istream &instream,
29  const std::string &path);
30 
31  virtual bool typecheck(
32  symbol_tablet &context,
33  const std::string &module);
34 
35  virtual bool final(
36  symbol_tablet &context);
37 
38  virtual void show_parse(std::ostream &out);
39 
40  virtual ~jsil_languaget();
42 
43  virtual bool from_expr(
44  const exprt &expr,
45  std::string &code,
46  const namespacet &ns);
47 
48  virtual bool from_type(
49  const typet &type,
50  std::string &code,
51  const namespacet &ns);
52 
53  virtual bool to_expr(
54  const std::string &code,
55  const std::string &module,
56  exprt &expr,
57  const namespacet &ns);
58 
60  { return new jsil_languaget; }
61 
62  virtual std::string id() const { return "jsil"; }
63  virtual std::string description() const
64  { return "Javascript Intermediate Language"; }
65  virtual std::set<std::string> extensions() const;
66 
67  virtual void modules_provided(std::set<std::string> &modules);
68  virtual bool interfaces(symbol_tablet &symbol_table);
69 
70 protected:
72  std::string parse_path;
73 };
74 
76 
77 #endif // CPROVER_JSIL_JSIL_LANGUAGE_H
The type of an expression.
Definition: type.h:20
virtual bool from_expr(const exprt &expr, std::string &code, const namespacet &ns)
virtual bool parse(std::istream &instream, const std::string &path)
jsil_parse_treet parse_tree
Definition: jsil_language.h:71
virtual bool preprocess(std::istream &instream, const std::string &path, std::ostream &outstream)
virtual std::set< std::string > extensions() const
virtual void modules_provided(std::set< std::string > &modules)
virtual std::string id() const
Definition: jsil_language.h:62
The symbol table.
Definition: symbol_table.h:52
TO_BE_DOCUMENTED.
Definition: namespace.h:62
Abstract interface to support a programming language.
virtual bool interfaces(symbol_tablet &symbol_table)
Adding symbols for all procedure declarations.
virtual languaget * new_language()
Definition: jsil_language.h:59
virtual void show_parse(std::ostream &out)
virtual ~jsil_languaget()
Jsil Language.
Base class for all expressions.
Definition: expr.h:46
std::string parse_path
Definition: jsil_language.h:72
virtual bool from_type(const typet &type, std::string &code, const namespacet &ns)
virtual bool to_expr(const std::string &code, const std::string &module, exprt &expr, const namespacet &ns)
virtual bool typecheck(symbol_tablet &context, const std::string &module)
Converting from parse tree and type checking.
languaget * new_jsil_language()
virtual std::string description() const
Definition: jsil_language.h:63