A cross-platform functional programming language

StringFormatExpr Class Reference

AST Node representing a string format expression. More...

#include <Ast.hpp>

Inheritance diagram for StringFormatExpr:
Expr Node

List of all members.

Public Member Functions

 StringFormatExpr (const QualifiedType &type, const Expr &format, const Ast::DictList &list)
 Default constructor.
const ExprgetFormat () const
 Returns the format expression.
const Ast::DictListgetList () const
 Returns the dict holding the values to be inserted.

Private Member Functions

virtual void visit (Expr::Visitor &visitor) const
 Abstract visitor function.

Private Attributes

const Expr_format
 The format expression.
const Ast::DictList_list
 The value dict.

Detailed Description

AST Node representing a string format expression.

An string format expression takes a string format and inserts values from a dict into it. For example:

        local y = "my name is %{name}" @ {@name:"renji"};

Here, @name is the key, and it's value is inserted into the string format at the location identfied by %{name}

Constructor & Destructor Documentation

StringFormatExpr ( const QualifiedType type,
const Expr format,
const Ast::DictList list 
) [inline]

Default constructor.

typeExpression type
formatThe format expression
listThe dict holding values to be inserted into the format

Member Function Documentation

const Expr& getFormat ( ) const [inline]

Returns the format expression.

The format expression
const Ast::DictList& getList ( ) const [inline]

Returns the dict holding the values to be inserted.

The value dict
void visit ( Expr::Visitor visitor) const [private, virtual]

Abstract visitor function.

visitorThe visitor object.

Implements Expr.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines