2008-07-18 18:18:29 -06:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package AST
|
|
|
|
|
|
|
|
import Globals "globals"
|
|
|
|
import Universe "universe"
|
|
|
|
|
|
|
|
|
2008-07-23 17:04:11 -06:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Expressions
|
|
|
|
|
2008-08-04 16:37:47 -06:00
|
|
|
export type BinaryExpr struct {
|
2008-07-31 14:35:30 -06:00
|
|
|
typ_ *Globals.Type;
|
2008-07-18 18:18:29 -06:00
|
|
|
op int;
|
2008-07-31 14:35:30 -06:00
|
|
|
x, y Globals.Expr;
|
2008-07-18 18:18:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-23 17:04:11 -06:00
|
|
|
|
2008-07-31 14:35:30 -06:00
|
|
|
func (x *BinaryExpr) typ() *Globals.Type {
|
|
|
|
return x.typ_;
|
2008-07-23 17:04:11 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-31 14:35:30 -06:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Statements
|
|
|
|
|
2008-08-04 16:37:47 -06:00
|
|
|
export type Block struct {
|
2008-07-23 17:04:11 -06:00
|
|
|
// TODO fill in
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-08-04 16:37:47 -06:00
|
|
|
export type IfStat struct {
|
2008-07-31 14:35:30 -06:00
|
|
|
cond Globals.Expr;
|
|
|
|
then_ Globals.Stat;
|
|
|
|
else_ Globals.Stat;
|
2008-07-18 18:18:29 -06:00
|
|
|
}
|