Documentation ¶
Index ¶
Constants ¶
View Source
const ( ILLEGAL = "ILLEGAL" EOF = "EOF" FLOAT = "FLOAT" PLUS = "+" MINUS = "-" ASTERISK = "*" SLASH = "/" LPAREN = "(" RPAREN = ")" )
View Source
const ( LOWEST int SUM // +, - PRODUCT // *, / PREFIX // -X CALL // (X) )
Variables ¶
This section is empty.
Functions ¶
func Eval ¶
func Eval(exp Expression) float64
Types ¶
type Expression ¶
type Expression interface {
String() string
}
type InfixExpression ¶
type InfixExpression struct { Token Token Left Expression Operator string Right Expression }
func (*InfixExpression) String ¶
func (ie *InfixExpression) String() string
type IntegerLiteralExpression ¶
func (*IntegerLiteralExpression) String ¶
func (il *IntegerLiteralExpression) String() string
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) ParseExpression ¶
func (p *Parser) ParseExpression(precedence int) Expression
type PrefixExpression ¶
type PrefixExpression struct { Token Token Operator string Right Expression }
func (*PrefixExpression) String ¶
func (pe *PrefixExpression) String() string
Click to show internal directories.
Click to hide internal directories.