This commit is contained in:
Andrew Gallant (Ocelot) 2012-04-30 02:44:31 -04:00
parent 05d8ec6a16
commit 2a2d8653b3
14 changed files with 163 additions and 233 deletions

View File

@ -1,15 +0,0 @@
package main
/*
A buffer count is a mechanism by which to keep track of which byte one
is reading or writing to/from the wire.
It's an abstraction over the fact that while such a counter is usually
fixed, it can be made variable based on values at run-time.
*/
type BufCount struct {
Fixed int
Exprs []*Expression
}

View File

@ -273,4 +273,3 @@ func (e *SumOf) String() string {
func (e *SumOf) Initialize(p *Protocol) { func (e *SumOf) Initialize(p *Protocol) {
e.Name = SrcName(e.Name) e.Name = SrcName(e.Name)
} }

View File

@ -167,4 +167,3 @@ type Bitcase struct {
Fields []Field Fields []Field
Expr Expression Expr Expression
} }

View File

@ -408,4 +408,3 @@ func (f *SwitchField) Define(c *Context) {
func (f *SwitchField) Read(c *Context) { func (f *SwitchField) Read(c *Context) {
c.Putln("// reading switch field: %s (%s)", f.Name, f.Expr) c.Putln("// reading switch field: %s (%s)", f.Name, f.Expr)
} }

View File

@ -62,4 +62,3 @@ func main() {
} }
} }
} }

View File

@ -1,50 +0,0 @@
// Morph cascades down all of the XML and calls each type's corresponding
// Morph function with itself as an argument (the context).
func (x *XML) Morph(c *Context) {
// Start the header...
c.Putln("package xgb")
c.Putln("/*")
c.Putln("\tX protocol API for '%s.xml'.", c.xml.Header)
c.Putln("\tThis file is automatically generated. Edit at your own peril!")
c.Putln("\tGenerated on %s",
time.Now().Format("Jan 2, 2006 at 3:04:05pm MST"))
c.Putln("*/")
c.Putln("")
x.Imports.Morph(c)
c.Putln("")
x.Enums.Morph(c)
c.Putln("")
x.Xids.Morph(c)
c.Putln("")
x.XidUnions.Morph(c)
c.Putln("")
x.TypeDefs.Morph(c)
c.Putln("")
x.Structs.Morph(c)
c.Putln("")
x.Unions.Morph(c)
c.Putln("")
x.Requests.Morph(c)
c.Putln("")
x.Errors.Morph(c)
c.Putln("")
x.ErrorCopies.Morph(c)
c.Putln("")
x.Events.Morph(c)
c.Putln("")
x.EventCopies.Morph(c)
c.Putln("")
}

View File

@ -53,4 +53,3 @@ func (r *Reply) Initialize(p *Protocol) {
field.Initialize(p) field.Initialize(p)
} }
} }

View File

@ -19,4 +19,3 @@ func (s1 Size) Add(s2 Size) Size {
func (s1 Size) Multiply(s2 Size) Size { func (s1 Size) Multiply(s2 Size) Size {
return Size{newBinaryOp("*", s1, s2)} return Size{newBinaryOp("*", s1, s2)}
} }

View File

@ -1,4 +1,5 @@
package main package main
/* /*
translation.go provides a 'Translate' method on every XML type that converts translation.go provides a 'Translate' method on every XML type that converts
the XML type into our "better" representation. the XML type into our "better" representation.

View File

@ -146,4 +146,3 @@ type XMLError struct {
Number int `xml:"number,attr"` Number int `xml:"number,attr"`
Fields XMLFields `xml:",any"` Fields XMLFields `xml:",any"`
} }

View File

@ -1,4 +1,5 @@
package main package main
/* /*
A series of fields should be taken as "structure contents", and *not* A series of fields should be taken as "structure contents", and *not*
just the single 'field' elements. Namely, 'fields' subsumes 'field' just the single 'field' elements. Namely, 'fields' subsumes 'field'