Index: uspace/app/sbi/src/stree_t.h
===================================================================
--- uspace/app/sbi/src/stree_t.h	(revision 38aaacc20a85af2361a0240ac2e7d643e086ecfa)
+++ uspace/app/sbi/src/stree_t.h	(revision 640ffe664a867642b35d372f9cf26c5898381793)
@@ -43,14 +43,14 @@
 typedef struct {
 	int sid;
+	struct cspan *cspan;
 } stree_ident_t;
 
 /** Name reference */
 typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+
 	stree_ident_t *name;
 } stree_nameref_t;
-
-/** Reference to currently active object. */
-typedef struct {
-} stree_self_ref_t;
 
 /** Boolean literal */
@@ -88,4 +88,7 @@
 /** Literal */
 typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+
 	literal_class_t ltc;
 	union {
@@ -98,4 +101,10 @@
 } stree_literal_t;
 
+/** Reference to currently active object. */
+typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+} stree_self_ref_t;
+
 /** Binary operation class */
 typedef enum {
@@ -108,5 +117,7 @@
 	bo_plus,
 	bo_minus,
-	bo_mult
+	bo_mult,
+	bo_and,
+	bo_or
 } binop_class_t;
 
@@ -115,8 +126,12 @@
 	uo_plus,
 	uo_minus,
+	uo_not
 } unop_class_t;
 
 /** Binary operation */
 typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+
 	/** Binary operation class */
 	binop_class_t bc;
@@ -128,4 +143,7 @@
 /** Unary operation */
 typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+
 	/** Operation class */
 	unop_class_t uc;
@@ -137,10 +155,19 @@
 /** New operation */
 typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+
 	/** Type of object to construct. */
 	struct stree_texpr *texpr;
+
+	/** Constructor arguments */
+	list_t ctor_args; /* of stree_expr_t */
 } stree_new_t;
 
 /** Member access operation */
 typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+
 	/** Argument */
 	struct stree_expr *arg;
@@ -151,4 +178,7 @@
 /** Function call operation */
 typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+
 	/** Function */
 	struct stree_expr *fun;
@@ -165,4 +195,7 @@
 /** Assignment */
 typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+
 	assign_class_t ac;
 	struct stree_expr *dest, *src;
@@ -171,4 +204,7 @@
 /** Indexing operation */
 typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+
 	/** Base */
 	struct stree_expr *base;
@@ -180,6 +216,10 @@
 /** @c as conversion operation */
 typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+
 	/** Expression to convert */
 	struct stree_expr *arg;
+
 	/** Destination type of conversion. */
 	struct stree_texpr *dtype;
@@ -193,4 +233,7 @@
  */
 typedef struct {
+	/** Expression backlink */
+	struct stree_expr *expr;
+
 	/* Primitive type expression */
 	struct stree_expr *arg;
@@ -217,5 +260,9 @@
 	expr_class_t ec;
 
+	/** Type of this expression or @c NULL if not typed yet */
 	struct tdata_item *titem;
+
+	/** Coordinate span */
+	struct cspan *cspan;
 
 	union {
@@ -252,4 +299,7 @@
 /** Type literal */
 typedef struct {
+	/** Type expression backlink */
+	struct stree_texpr *texpr;
+
 	tliteral_class_t tlc;
 } stree_tliteral_t;
@@ -257,4 +307,7 @@
 /** Type name reference */
 typedef struct {
+	/** Type expression backlink */
+	struct stree_texpr *texpr;
+
 	stree_ident_t *name;
 } stree_tnameref_t;
@@ -262,6 +315,10 @@
 /** Type member access operation */
 typedef struct {
+	/** Type expression backlink */
+	struct stree_texpr *texpr;
+
 	/** Argument */
 	struct stree_texpr *arg;
+
 	/** Name of member being accessed. */
 	stree_ident_t *member_name;
@@ -270,4 +327,7 @@
 /** Type application operation */
 typedef struct {
+	/** Type expression backlink */
+	struct stree_texpr *texpr;
+
 	/* Base type */
 	struct stree_texpr *gtype;
@@ -279,4 +339,7 @@
 /** Type index operation */
 typedef struct {
+	/** Type expression backlink */
+	struct stree_texpr *texpr;
+
 	/** Base type */
 	struct stree_texpr *base_type;
@@ -304,4 +367,7 @@
 typedef struct stree_texpr {
 	texpr_class_t tc;
+
+	/** Coordinate span */
+	struct cspan *cspan;
 
 	union {
@@ -337,8 +403,16 @@
 } stree_except_t;
 
+/** @c if or @c elif clause */
+typedef struct {
+	stree_expr_t *cond;
+	stree_block_t *block;
+} stree_if_clause_t;
+
 /** If statement */
 typedef struct {
-	stree_expr_t *cond;
-	stree_block_t *if_block;
+	/** If and elif clauses */
+	list_t if_clauses; /* of stree_if_clause_t */
+
+	/** Else block */
 	stree_block_t *else_block;
 } stree_if_t;
@@ -359,4 +433,8 @@
 	stree_expr_t *expr;
 } stree_raise_t;
+
+/** Break statement */
+typedef struct {
+} stree_break_t;
 
 /** Return statement */
@@ -384,4 +462,5 @@
 	st_for,
 	st_raise,
+	st_break,
 	st_return,
 	st_exps,
@@ -399,4 +478,5 @@
 		stree_for_t *for_s;
 		stree_raise_t *raise_s;
+		stree_break_t *break_s;
 		stree_return_t *return_s;
 		stree_exps_t *exp_s;
@@ -461,4 +541,22 @@
 } stree_proc_t;
 
+/** Constructor declaration */
+typedef struct stree_ctor {
+	/** Constructor 'name'. Points to the @c new keyword. */
+	stree_ident_t *name;
+
+	/** Symbol */
+	struct stree_symbol *symbol;
+
+	/** Signature (arguments, return type is always none) */
+	stree_fun_sig_t *sig;
+
+	/** Constructor implementation */
+	stree_proc_t *proc;
+
+	/** Type item describing the constructor */
+	struct tdata_item *titem;
+} stree_ctor_t;
+
 /** Delegate declaration */
 typedef struct stree_deleg {
@@ -476,4 +574,28 @@
 } stree_deleg_t;
 
+/** Enum member */
+typedef struct stree_embr {
+	/** Enum containing this declaration */
+	struct stree_enum *outer_enum;
+
+	/** Enum member name */
+	stree_ident_t *name;
+} stree_embr_t;
+
+/** Enum declaration */
+typedef struct stree_enum {
+	/** Enum name */
+	stree_ident_t *name;
+
+	/** Symbol */
+	struct stree_symbol *symbol;
+
+	/** List of enum members */
+	list_t members; /* of stree_embr_t */
+
+	/** Type item describing the enum */
+	struct tdata_item *titem;
+} stree_enum_t;
+
 /** Member function declaration */
 typedef struct stree_fun {
@@ -521,11 +643,13 @@
 /**
  * Fake identifiers used with symbols that do not really have one.
- * (Mostly for error messages.)
  */
+#define CTOR_IDENT "$ctor"
 #define INDEXER_IDENT "$indexer"
 
 typedef enum {
 	csimbr_csi,
+	csimbr_ctor,
 	csimbr_deleg,
+	csimbr_enum,
 	csimbr_fun,
 	csimbr_var,
@@ -539,5 +663,7 @@
 	union {
 		struct stree_csi *csi;
+		stree_ctor_t *ctor;
 		stree_deleg_t *deleg;
+		stree_enum_t *enum_d;
 		stree_fun_t *fun;
 		stree_var_t *var;
@@ -587,5 +713,7 @@
 typedef enum {
 	/* Class, struct or interface declaration */
-	mc_csi
+	mc_csi,
+	/* Enum declaration */
+	mc_enum
 } modm_class_t;
 
@@ -595,4 +723,5 @@
 	union {
 		stree_csi_t *csi;
+		stree_enum_t *enum_d;
 	} u;
 } stree_modm_t;
@@ -618,6 +747,10 @@
 	/** CSI (class, struct or interface) */
 	sc_csi,
+	/** Constructor */
+	sc_ctor,
 	/** Member delegate */
 	sc_deleg,
+	/** Enum */
+	sc_enum,
 	/** Member function */
 	sc_fun,
@@ -638,5 +771,7 @@
 	union {
 		struct stree_csi *csi;
+		stree_ctor_t *ctor;
 		stree_deleg_t *deleg;
+		stree_enum_t *enum_d;
 		stree_fun_t *fun;
 		stree_var_t *var;
