00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef CBZ_SEMCHECK_H
00038 #define CBZ_SEMCHECK_H
00039
00040
00041
00042
00043
00044 class semcheck_walker : public Walker
00045 {
00046 public:
00047
00048 static void check(unitNode * u, bool verbose);
00049
00050 private:
00051
00052 semcheck_walker()
00053 : Walker(Postorder, Subtree)
00054 {}
00055
00056 public:
00057
00058 virtual void at_exprstmt(exprstmtNode * the_exprstmt, Order ord);
00059 virtual void at_suespec(suespecNode * the_suespec, Order ord);
00060 };
00061
00062
00063
00064 class semcheck_expr_visitor : public Visitor
00065 {
00066 public:
00067
00068
00069
00070 static void check(exprNode * e);
00071 static void check(unitNode * u);
00072
00073 private:
00074
00075 typeNode * default_type();
00076 typeNode * check_binary(unsigned int opid, exprNode * lhs, exprNode * rhs,
00077 exprNode ** new_lhs, exprNode ** new_rhs);
00078 typeNode * check_unary(unsigned int opid, exprNode * ex,
00079 exprNode ** new_ex);
00080
00081 semcheck_expr_visitor()
00082 : Visitor()
00083 {}
00084
00085 public:
00086
00087 virtual void at_const(constNode * the_const);
00088 virtual void at_id(idNode * the_id);
00089 virtual void at_binary(binaryNode * the_binary);
00090 virtual void at_unary(unaryNode * the_unary);
00091 virtual void at_cast(castNode * the_cast);
00092 virtual void at_comma(commaNode * the_comma);
00093 virtual void at_ternary(ternaryNode * the_ternary);
00094 virtual void at_call(callNode * the_call);
00095 virtual void at_initializer(initializerNode * the_initializer);
00096
00097 };
00098
00099
00100 #endif // CBZ_SEMCHECK_H