token

package
v0.0.0-...-620ce17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2015 License: BSD-3-Clause Imports: 0 Imported by: 2

Documentation

Index

Constants

View Source
const (
	IntLit    = "INT"    // integer (1, 2, 3, ...)
	FloatLit  = "FLOAT"  // floatint point number (1.2)
	ImagLit   = "IMAG"   // imaginary number (complex number)
	CharLit   = "CHAR"   // character ('a', 'b', 'c', ...)
	StringLit = "STRING" // string ("foo")
	BoolLit   = "BOOl"   // boolean (true/false)
	NilLit    = "NIL"    // null value (nil, null, NULL, ...)
)

Literals

View Source
const (
	// numerical operators
	ADD = "ADD" // addition
	SUB = "SUB" // subtraction
	MUL = "MUL" // multiplication
	QUO = "QUO" // division
	MOD = "MOD" // modulo

	// logical operators
	AND     = "AND"         // binary and (&)
	OR      = "OR"          // binary or (|)
	XOR     = "XOR"         // binary xor (^)
	SHL     = "SHIFT_LEFT"  // binary left shift <<
	SHR     = "SHIFT_RIGHT" // binary right shift >>
	AND_NOT = "AND_NOT"     // binary and not (&^)

	// comparison operators
	NEQ  = "NEQ"  // not equal
	LEQ  = "LEQ"  // less or equal
	GEQ  = "GEQ"  // greater or equal
	EQ   = "EQ"   // equal
	LSS  = "LSS"  // less
	GTR  = "GTR"  // greater
	LAND = "LAND" // and (&&)
	LOR  = "LOR"  // or (||)
)

Binary operators

View Source
const (
	ConstDecl = "CONSTANT" // constant
	VarDecl   = "VAR"      // variable
)

Kind of declarations

View Source
const (
	INC = "INC" // increment operator (i++)
	DEC = "DEC" // decreement operator (i--)
)

Increment/Decrement operators

View Source
const (
	NOT  = "NOT"  // negation operator
	ADDR = "ADDR" // memory address (&foo)
	STAR = "STAR" // dereference operator (*foo)

	NEG = "NEG" // negative sign (-)
	POS = "POS" // positive sign (+)
)

Unary operators

View Source
const (
	IfStmtName        = "IF"         // if statement
	SwitchStmtName    = "SWITCH"     // switch statement
	LoopStmtName      = "LOOP"       // loop statement (for, while, do...while, ...)
	RangeLoopStmtName = "RANGE_LOOP" // range loops( for foo := range bar, for foo in bar, ...)
	AssignStmtName    = "ASSIGN"     // assign statement (foo = bar)
	DeclStmtName      = "DECL"       // declaration statement (int foo = 42, foo := 42, ...)
	ReturnStmtName    = "RETURN"     // return statement (return 42)
	ExprStmtName      = "EXPR"       // expression statement
	TryStmtName       = "TRY"        // try...catch statement
	ThrowStmtName     = "THROW"      // throw exception
	OtherStmtName     = "OTHER"      // any other not supported statement
)

Statement names

View Source
const (
	// Expression names
	UnaryExprName           = "UNARY"            // unary expression (!foo)
	BinaryExprName          = "BINARY"           // binary expression (foo && bar)
	TernaryExprName         = "TERNARY"          // ternary expression (foo ? 42 : 0)
	IncDecExprName          = "INC_DEC"          // increment/decrement expression (i++/i--)
	CallExprName            = "CALL"             // call expression (foo(42))
	ConstructorCallExprName = "CONSTRUCTOR_CALL" // constructor call expression (foo = new Foo())
	ArrayExprName           = "ARRAY"            // array expression
	IndexExprName           = "INDEX"            // index expression (foo[i])

	// Literal names
	BasicLitName = "BASIC_LIT" // basic literal ("foo", 42, 12.34, ...)
	FuncLitName  = "FUNC_LIT"  // function literal (foo := func() { ... })
	ClassLitName = "CLASS_LIT" // class literal
	ArrayLitName = "ARRAY_LIT" // array literal (foo = [1,2,3])

	// Type names
	StructTypeName = "STRUCT_TYPE" // struct type

	// Other
	AttrRefName   = "ATTR_REF"   // attribute reference (this.foo)
	ValueSpecName = "VALUE_SPEC" // value specifier
	IdentName     = "IDENT"      // identifier
)

Expression names

View Source
const (
	PublicVisibility    = "public"    // public (visible from everywhere)
	PackageVisibility   = "package"   // package (visible from every entity inside the package)
	ProtectedVisibility = "protected" // protected (only visible from subclasses)
	PrivateVisibility   = "private"   // private
)

Supported visiblities

View Source
const (
	TypeMapName         = "MAP"         // hash map
	TypeStructName      = "STRUCT"      // structure
	TypeArrayName       = "ARRAY"       // array
	TypeFuncName        = "FUNC"        // function
	TypeInterfaceName   = "INTERFACE"   // interface
	TypeUnsupportedName = "UNSUPPORTED" // unsupported type (for error)
)

Type names

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL