complete and total overhaul like i promised. things are much easier to reason about. still not working yet though.

This commit is contained in:
Andrew Gallant (Ocelot)
2012-04-30 02:40:55 -04:00
parent 3115c13e88
commit 05d8ec6a16
13 changed files with 1777 additions and 787 deletions

22
nexgb/xgbgen/size.go Normal file
View File

@@ -0,0 +1,22 @@
package main
type Size struct {
Expression
}
func newFixedSize(fixed uint) Size {
return Size{&Value{v: fixed}}
}
func newExpressionSize(variable Expression) Size {
return Size{variable}
}
func (s1 Size) Add(s2 Size) Size {
return Size{newBinaryOp("+", s1, s2)}
}
func (s1 Size) Multiply(s2 Size) Size {
return Size{newBinaryOp("*", s1, s2)}
}