HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Friends
tt::template_node Struct Reference

Public Types

using statement_vector = typename std::vector<std::unique_ptr<template_node>>
 

Public Member Functions

 template_node (parse_location location)
 
virtual bool append (std::unique_ptr< template_node > x) noexcept
 Append a template-piece to the current template.
 
virtual bool should_left_align () const noexcept
 Should any spaces on the left side of a statement be removed?
 
virtual void left_align () noexcept
 Remove any trailing spaces or tabs after a new-line.
 
virtual bool found_elif (parse_location _location, std::unique_ptr< expression_node > expression) noexcept
 
virtual bool found_else (parse_location _location) noexcept
 
virtual bool found_while (parse_location _location, std::unique_ptr< expression_node > expression) noexcept
 
virtual void post_process (expression_post_process_context &context)
 
virtual datum evaluate (expression_evaluation_context &context)
 Evaluate the template.
 
std::string evaluate_output (expression_evaluation_context &context)
 
std::string evaluate_output ()
 
virtual std::string string () const noexcept
 

Static Public Member Functions

static void append_child (statement_vector &children, std::unique_ptr< template_node > new_child)
 
static datum evaluate_expression_without_output (expression_evaluation_context &context, expression_node const &expression, parse_location const &location)
 
static datum evaluate_expression (expression_evaluation_context &context, expression_node const &expression, parse_location const &location)
 
static void post_process_expression (expression_post_process_context &context, expression_node &expression, parse_location const &location)
 
static datum evaluate_children (expression_evaluation_context &context, statement_vector const &children)
 

Data Fields

parse_location location
 

Friends

std::string to_string (template_node const &lhs) noexcept
 
std::ostreamoperator<< (std::ostream &lhs, template_node const &rhs)
 

Member Function Documentation

◆ append()

virtual bool tt::template_node::append ( std::unique_ptr< template_node > x)
inlinevirtualnoexcept

Append a template-piece to the current template.

◆ evaluate()

virtual datum tt::template_node::evaluate ( expression_evaluation_context & context)
inlinevirtual

Evaluate the template.

Text in the template is added to the context.output_text.

Parameters
contextData used by expressions inside the template statements. .output_text will contain textual data from the template.
Returns
datum::undefined when the template_node generated textual data into context.output_text. datum::break when a #break statement was encountered. datum::continue when a #continue statement was encountered. Otherwise data returned from a #return statement.

◆ left_align()

virtual void tt::template_node::left_align ( )
inlinevirtualnoexcept

Remove any trailing spaces or tabs after a new-line.

◆ should_left_align()

virtual bool tt::template_node::should_left_align ( ) const
inlinevirtualnoexcept

Should any spaces on the left side of a statement be removed?


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