JUCE  v5.2.0-514-g49784a029
JUCE API
juce::littlefoot::Compiler::SyntaxTreeBuilder Struct Reference
Inheritance diagram for juce::littlefoot::Compiler::SyntaxTreeBuilder:
Collaboration diagram for juce::littlefoot::Compiler::SyntaxTreeBuilder:

Public Member Functions

 SyntaxTreeBuilder (const String &code, const Array< NativeFunction > &nativeFns, uint32 defaultHeapSize)
 
template<typename Type , typename... Args>
Typeallocate (Args... args)
 
void compile ()
 
const FunctionfindFunction (FunctionID functionID) const noexcept
 
const NativeFunctionfindNativeFunction (FunctionID functionID) const noexcept
 
void simplify ()
 

Public Attributes

BlockPtr blockBeingParsed = nullptr
 
Array< Function * > functions
 
uint32 heapSizeRequired
 
const Array< NativeFunction > & nativeFunctions
 

Private Member Functions

String getIdentifierFromExpression (ExpPtr e)
 
void match (TokenType expected)
 
ExpPtr matchCloseParen (ExpPtr e)
 
template<typename ExpType >
ExpType matchEndOfStatement (ExpType e)
 
template<typename... Args>
bool matchesAny (TokenType t1, Args... others) const noexcept
 
bool matchesAny (TokenType t1) const noexcept
 
bool matchesAnyType () const noexcept
 
bool matchesAnyTypeOrVoid () const noexcept
 
bool matchIf (TokenType expected)
 
ExpPtr parseAdditionSubtraction ()
 
BlockPtr parseBlock (bool isMainBlockOfFunction)
 
ExpPtr parseComparator ()
 
void parseCompilerDirective ()
 
var parseConstantExpressionInitialiser (Type expectedType)
 
StatementPtr parseDoOrWhileLoop (bool isDoLoop)
 
ExpPtr parseExpression ()
 
ExpPtr parseFactor ()
 
StatementPtr parseForLoop ()
 
ExpPtr parseFunctionCall (const String &name)
 
void parseFunctionDeclaration (Type returnType, const String &name)
 
void parseGlobalVariableDeclaraion (bool isConst, Type type, String name)
 
String parseIdentifier ()
 
StatementPtr parseIf ()
 
ExpPtr parseInPlaceOpExpression (ExpPtr lhs, TokenType opType)
 
int parseIntegerLiteral ()
 
ExpPtr parseLogicOperator ()
 
ExpPtr parseMultiplyDivide ()
 
ExpPtr parsePostIncDec (ExpPtr lhs, TokenType opType)
 
ExpPtr parsePreIncDec (TokenType opType)
 
StatementPtr parseReturn ()
 
ExpPtr parseShiftOperator ()
 
StatementPtr parseStatement ()
 
ExpPtr parseSuffixes (ExpPtr input)
 
ExpPtr parseTernaryOperator (ExpPtr condition)
 
ExpPtr parseUnary ()
 
StatementPtr parseVariableDeclaration (bool isConst)
 
TokenType skip ()
 
void throwErrorExpecting (const String &expected)
 

Private Attributes

OwnedArray< AllocatedObjectallAllocatedObjects
 
TokenType currentType
 
var currentValue
 
CodeLocation location
 

Constructor & Destructor Documentation

◆ SyntaxTreeBuilder()

juce::littlefoot::Compiler::SyntaxTreeBuilder::SyntaxTreeBuilder ( const String code,
const Array< NativeFunction > &  nativeFns,
uint32  defaultHeapSize 
)
inline

Member Function Documentation

◆ allocate()

template<typename Type , typename... Args>
Type* juce::littlefoot::Compiler::SyntaxTreeBuilder::allocate ( Args...  args)
inline

◆ compile()

void juce::littlefoot::Compiler::SyntaxTreeBuilder::compile ( )
inline

◆ findFunction()

const Function* juce::littlefoot::Compiler::SyntaxTreeBuilder::findFunction ( FunctionID  functionID) const
inlinenoexcept

◆ findNativeFunction()

const NativeFunction* juce::littlefoot::Compiler::SyntaxTreeBuilder::findNativeFunction ( FunctionID  functionID) const
inlinenoexcept

◆ getIdentifierFromExpression()

String juce::littlefoot::Compiler::SyntaxTreeBuilder::getIdentifierFromExpression ( ExpPtr  e)
inlineprivate

◆ match()

void juce::littlefoot::Compiler::TokenIterator::match ( TokenType  expected)
inlineinherited

◆ matchCloseParen()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::matchCloseParen ( ExpPtr  e)
inlineprivate

◆ matchEndOfStatement()

template<typename ExpType >
ExpType juce::littlefoot::Compiler::SyntaxTreeBuilder::matchEndOfStatement ( ExpType  e)
inlineprivate

◆ matchesAny() [1/2]

template<typename... Args>
bool juce::littlefoot::Compiler::TokenIterator::matchesAny ( TokenType  t1,
Args...  others 
) const
inlinenoexceptinherited

◆ matchesAny() [2/2]

bool juce::littlefoot::Compiler::TokenIterator::matchesAny ( TokenType  t1) const
inlinenoexceptinherited

◆ matchesAnyType()

bool juce::littlefoot::Compiler::SyntaxTreeBuilder::matchesAnyType ( ) const
inlineprivatenoexcept

◆ matchesAnyTypeOrVoid()

bool juce::littlefoot::Compiler::SyntaxTreeBuilder::matchesAnyTypeOrVoid ( ) const
inlineprivatenoexcept

◆ matchIf()

bool juce::littlefoot::Compiler::TokenIterator::matchIf ( TokenType  expected)
inlineinherited

◆ parseAdditionSubtraction()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseAdditionSubtraction ( )
inlineprivate

◆ parseBlock()

BlockPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseBlock ( bool  isMainBlockOfFunction)
inlineprivate

◆ parseComparator()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseComparator ( )
inlineprivate

◆ parseCompilerDirective()

void juce::littlefoot::Compiler::SyntaxTreeBuilder::parseCompilerDirective ( )
inlineprivate

◆ parseConstantExpressionInitialiser()

var juce::littlefoot::Compiler::SyntaxTreeBuilder::parseConstantExpressionInitialiser ( Type  expectedType)
inlineprivate

◆ parseDoOrWhileLoop()

StatementPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseDoOrWhileLoop ( bool  isDoLoop)
inlineprivate

◆ parseExpression()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseExpression ( )
inlineprivate

◆ parseFactor()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseFactor ( )
inlineprivate

◆ parseForLoop()

StatementPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseForLoop ( )
inlineprivate

◆ parseFunctionCall()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseFunctionCall ( const String name)
inlineprivate

◆ parseFunctionDeclaration()

void juce::littlefoot::Compiler::SyntaxTreeBuilder::parseFunctionDeclaration ( Type  returnType,
const String name 
)
inlineprivate

◆ parseGlobalVariableDeclaraion()

void juce::littlefoot::Compiler::SyntaxTreeBuilder::parseGlobalVariableDeclaraion ( bool  isConst,
Type  type,
String  name 
)
inlineprivate

◆ parseIdentifier()

String juce::littlefoot::Compiler::SyntaxTreeBuilder::parseIdentifier ( )
inlineprivate

◆ parseIf()

StatementPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseIf ( )
inlineprivate

◆ parseInPlaceOpExpression()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseInPlaceOpExpression ( ExpPtr  lhs,
TokenType  opType 
)
inlineprivate

◆ parseIntegerLiteral()

int juce::littlefoot::Compiler::SyntaxTreeBuilder::parseIntegerLiteral ( )
inlineprivate

◆ parseLogicOperator()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseLogicOperator ( )
inlineprivate

◆ parseMultiplyDivide()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseMultiplyDivide ( )
inlineprivate

◆ parsePostIncDec()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parsePostIncDec ( ExpPtr  lhs,
TokenType  opType 
)
inlineprivate

◆ parsePreIncDec()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parsePreIncDec ( TokenType  opType)
inlineprivate

◆ parseReturn()

StatementPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseReturn ( )
inlineprivate

◆ parseShiftOperator()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseShiftOperator ( )
inlineprivate

◆ parseStatement()

StatementPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseStatement ( )
inlineprivate

◆ parseSuffixes()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseSuffixes ( ExpPtr  input)
inlineprivate

◆ parseTernaryOperator()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseTernaryOperator ( ExpPtr  condition)
inlineprivate

◆ parseUnary()

ExpPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseUnary ( )
inlineprivate

◆ parseVariableDeclaration()

StatementPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::parseVariableDeclaration ( bool  isConst)
inlineprivate

◆ simplify()

void juce::littlefoot::Compiler::SyntaxTreeBuilder::simplify ( )
inline

◆ skip()

TokenType juce::littlefoot::Compiler::TokenIterator::skip ( )
inlineinherited

◆ throwErrorExpecting()

void juce::littlefoot::Compiler::TokenIterator::throwErrorExpecting ( const String expected)
inlineinherited

Member Data Documentation

◆ allAllocatedObjects

OwnedArray<AllocatedObject> juce::littlefoot::Compiler::SyntaxTreeBuilder::allAllocatedObjects
private

◆ blockBeingParsed

BlockPtr juce::littlefoot::Compiler::SyntaxTreeBuilder::blockBeingParsed = nullptr

◆ currentType

TokenType juce::littlefoot::Compiler::TokenIterator::currentType
inherited

◆ currentValue

var juce::littlefoot::Compiler::TokenIterator::currentValue
inherited

◆ functions

Array<Function*> juce::littlefoot::Compiler::SyntaxTreeBuilder::functions

◆ heapSizeRequired

uint32 juce::littlefoot::Compiler::SyntaxTreeBuilder::heapSizeRequired

◆ location

CodeLocation juce::littlefoot::Compiler::TokenIterator::location
inherited

◆ nativeFunctions

const Array<NativeFunction>& juce::littlefoot::Compiler::SyntaxTreeBuilder::nativeFunctions

The documentation for this struct was generated from the following file: