Documentation ¶
Index ¶
- func RemoveComments(raw string) string
- type AccessibilityModifier
- type ArrayLiteral
- type Assignment
- type Bit
- type Class
- type ClassMember
- type Construction
- type Enum
- type Expression
- type ExpressionPart
- type ForEachLoop
- type ForLoop
- type IfStatement
- type Literal
- type LocalVarDefinition
- type MethodCall
- type Namespace
- type NamespaceDeclaration
- type NamespaceMember
- type ObjectName
- type Operator
- type Parameter
- type Statement
- type TypeName
- type Up
- type WhileLoop
- type WithDeclaration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveComments ¶
Types ¶
type AccessibilityModifier ¶
type AccessibilityModifier int
const ( AccessModPublic AccessibilityModifier = iota AccessModPrivate AccessModOperator )
func (*AccessibilityModifier) Capture ¶
func (a *AccessibilityModifier) Capture(values []string) error
type ArrayLiteral ¶
type ArrayLiteral struct { Type *TypeName `"new" "[""]" @@` Contents []*Expression `"{" ((@@ ",")* @@)? "}"` }
type Assignment ¶
type Assignment struct { Target *ObjectName `@@ "="` ValueToAssign *Expression `@@` }
type Class ¶
type Class struct { Name string `"class" @Ident` Members []*ClassMember `"{" (@@ ";")* "}"` }
type ClassMember ¶
type ClassMember struct { Accessibility *AccessibilityModifier `@("public" | "private" | "operator")` Name string `@Ident` Parameters []*Parameter `("(" (@@ ","?)* ")")?` Type *TypeName `@@` MethodBody []*Statement `("{" @@* "}")?` }
type Construction ¶
type Construction struct { Type *TypeName `"new" @@` Params []*Expression `"(" (@@ ",")* @@ ")"` }
type Expression ¶
type Expression struct {
Parts []*ExpressionPart `@@+`
}
type ExpressionPart ¶
type ExpressionPart struct { Null bool `@"null"` Literal *Literal `|@@` Call *MethodCall `|@@` Construction *Construction `|@@` Parenthesis *Expression `|"(" @@ ")"` Operator *Operator `` /* 126-byte string literal not displayed */ ObjAccess *ObjectName `|@@` }
type ForEachLoop ¶
type ForEachLoop struct { VarName string `"foreach" "(" "var" @Ident` VarType *TypeName `@@` IndexName string `"index" @Ident` Collection *Expression `"in" @@ ")"` Body []*Statement `"{" @@* "}"` }
type ForLoop ¶
type ForLoop struct { VarCreation *Statement `"for" "(" @@ ";"` Condition *Expression `@@ ";"` Increment *Statement `@@ ")"` Body []*Statement `"{" @@* "}"` }
type IfStatement ¶
type IfStatement struct { Condition *Expression `"if" "(" @@ ")"` Body []*Statement `"{" @@* "}"` }
type LocalVarDefinition ¶
type LocalVarDefinition struct { Name string `"var" @Ident` Type *TypeName `@@` ValueToAssign *Expression `("=" @@)?` }
type MethodCall ¶
type MethodCall struct { Name *ObjectName `@@` Params []*Expression `"(" (@@ ",")* @@ ")"` }
type NamespaceDeclaration ¶
type NamespaceDeclaration struct { Name *Namespace `"namespace" @@` Members []*NamespaceMember `("{" @@* "}"` Class *Class `|@@` Enum *Enum `|@@)` }
type NamespaceMember ¶
type ObjectName ¶
type Statement ¶
type Statement struct { Return *Expression `"return" @@ ";"` VarDef *LocalVarDefinition `|@@ ";"` Assignment *Assignment `|@@ ";"` Method *MethodCall `|@@ ";"` If *IfStatement `|@@ ";"` For *ForLoop `|@@ ";"` ForEach *ForEachLoop `|@@ ";"` While *WhileLoop `|@@ ";"` }
type Up ¶
type Up struct { WithDeclarations []*WithDeclaration `@@*` NamespaceDeclarations []*NamespaceDeclaration `@@*` }
func ParseFromFile ¶
type WhileLoop ¶
type WhileLoop struct { Condition *Expression `"while" "(" @@ ")"` Body []*Statement `"{" @@* "}"` }
type WithDeclaration ¶
type WithDeclaration struct {
Namespace *Namespace `"with" @@ ";"`
}
Click to show internal directories.
Click to hide internal directories.