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-07-18 18:18:29 -06:00
|
|
|
export Expr
|
2008-07-23 17:04:11 -06:00
|
|
|
type Expr interface {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export BinaryExpr
|
|
|
|
type BinaryExpr struct {
|
2008-07-18 18:18:29 -06:00
|
|
|
typ *Globals.Type;
|
|
|
|
op int;
|
2008-07-23 17:04:11 -06:00
|
|
|
x, y Expr;
|
2008-07-18 18:18:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-23 17:04:11 -06:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Statements
|
|
|
|
|
2008-07-18 18:18:29 -06:00
|
|
|
export Stat
|
2008-07-23 17:04:11 -06:00
|
|
|
type Stat interface {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export Block
|
|
|
|
type Block struct {
|
|
|
|
// TODO fill in
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export IfStat
|
|
|
|
type IfStat struct {
|
|
|
|
cond Expr;
|
|
|
|
then_ Stat;
|
|
|
|
else_ Stat;
|
2008-07-18 18:18:29 -06:00
|
|
|
}
|