package
1.1.0
Repository: https://github.com/nv7-github/bpp.git
Documentation: pkg.go.dev

# Functions

MatchTypes compares 2 signatures, and is used in type-checking for function and block parsing.
NewPos creates a new initialized Pos with the values supplied.
NewScope creates a new initialized scope from a block.
NewScopeStack creates a new initialized stack of scopes.
Parse parses B++ source code and returns a parsed program.
ParseArgs parses the source code of arguments to a function.
ParseData parses a literal and converts it to a Data statement with the corresponding type.
ParseFiles parses multiple B++ source code files, accepting the name of the main file and a map of filename to source code.
ParseStmt parses a B++ statement's source code and returns the parsed statement.
SetupArrays adds the ARRAY and INDEX functions.
SetupBlocks adds the IFB and WHILE functions.
SetupComparisons adds the IF and COMPARE functions.
SetupFunctions adds the PARAM statement and the FUNCTION block.
SetupMath adds the MATH, ROUND, FLOOR, and CEIL statements.
SetupOthers adds the ARGS, CONCAT, and REPEAT statements.
SetupRandoms adds the RANDINT, RANDOM, and CHOOSE statements.
SetupTypes adds the type-cast parsers for STRING, INT, FLOAT, and LIST.
SetupVariables adds the DEFINE and VAR statements.

# Constants

+.
interface{}.
[]Data.
/.
=.
float64.
>.
>=.
string.
int.
<.
<=.
*.
!=.
nil.
interface{}.
For PARAM statements.
^.
string.
-.
Multiple args.

# Structs

ArgsStmt is the equivalent of [ARGS stmt.Index].
ArrayStmt is the equivalent of [ARRAY stmt.Values[0] stmt.Values[1] etc...].
BasicStatement allows other statements to implement the Statement interface.
BlockParser defines the type of a block parser - a function to parse the first statement of a block and return a block object based on that, and the signature of the first statement in the block.
CeilStmt is the equivalent of [CEIL stmt.Val].
ChooseStmt is the equivalent of [CHOOSE stmt.Data].
ComparisonStmt is the equivalent of [COMPARE stmt.Left stmt.Operation stmt.Right].
ConcatStmt is the equivalent of [CONCAT stmt.Strings].
Data represents a piece of Data in B++, most often a literal.
DefineStmt is the equivalent of [DEFINE stmt.Label stmt.Value].
FloorStmt is the equivalent of [FLOOR stmt.Val].
FunctionBlock is the equivalent of [IFB stmt.Condition] stmt.Body [ELSE] stmt.Else [ENDIF], the stmt.Else may be nil.
FunctionCallStmt is the equivalent of [stmt.Name stmt.Args...].
FunctionType stores the types of a function signature.
IfBlock is the equivalent of [IFB stmt.Condition] stmt.Body [ELSE] stmt.Else [ENDIF], the stmt.Else may be nil.
IfStmt is the equivalent of [IF stmt.Condition stmt.Body stmt.Else].
ImportStmt is the AST tree resulted of [IMPORT stmt.Filename].
IndexStmt is the equivalent of [VAR stmt.Label stmt.Index].
LengthStmt is the equivalent of [LENGTH stmt.Value].
MathStmt is the equivalent of [MATH stmt.Left stmt.Operation stmt.Right].
ParamStmt is the equivalent of [PARAM stmt.Name stmt.Type].
Pos defines a position in a B++ program, commonly used in debug prints.
Program is the main program, containing the source AST.
RandintStmt is the equivalent of [RANDINT stmt.Lower stmt.Upper].
RandomStmt is the equivalent of [RANDOM stmt.Lower stmt.Upper].
RoundStmt is the equivalent of [ROUND stmt.Val].
Scope represents the data of a B++ scope.
ScopeStack represents the data for a program's scopes - a Stack of scopes.
StatementParser defines the type for a statement parser - a cusotm function that can parse the statement and a signature of its parameters.
TypeCastStmt is the equivalent of [stmt.NewType stmt.Val].
VarStmt is the equivalent of [VAR stmt.Label].
WhileBlock is the equivalent of [WHILE stmt.Condition] [ENDWHILE].

# Interfaces

Block is a statement that supports being multiple types.
Statement stores the data for everything in B++.

# Type aliases

DataType is an enum for all B++ data types.
Operator is an enum for all the B++ math and comparison operators.