parse

package
v0.0.0-...-44c2662 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package parse provides the functionality for parsing raw text into an

in memory representation of Go

For Example: Raw text -> Functions Raw text -> Expression ...and so on

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Classifier

type Classifier interface {
	Type() T
}

Classifier allows types to identify themselves

type Expression

type Expression struct {
	Raw string
}

Expression is anything that is not a function

func (Expression) String

func (e Expression) String() string

func (*Expression) Type

func (e *Expression) Type() T

Type is an identifier for the Function type

type Function

type Function struct {
	// Raw, the raw input which was determined to be a function
	Raw string

	// Identifier, the identifier of the function.
	// For example:
	// func a() {}
	// Identifier would = a
	Identifier string

	// Params is a raw string which identifies the parameters of the function
	Params string

	// Return is the return signature of the function
	Return string

	// Body is everything which is contained in the function
	Body string
}

Function is the in memory representation of a function

func (Function) String

func (f Function) String() (str string)

func (Function) Type

func (f Function) Type() T

Type is an identifier for the Function type

type T

type T int

T is a constant identifier for concepts in Go

const (
	// Tfunction represents a parse.Function
	Tfunction T = iota

	// Texpression represents a parse.Expression
	Texpression
)

Directories

Path Synopsis
Package parseast parses raw text into a format that iGo can understand
Package parseast parses raw text into a format that iGo can understand

Jump to

Keyboard shortcuts

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