LibreOffice Module svx (master)  1
Public Member Functions | Static Public Member Functions | List of all members
EnhancedCustomShape::FunctionParser Class Reference

#include <EnhancedCustomShapeFunctionParser.hxx>

Public Member Functions

 FunctionParser ()=delete
 
 FunctionParser (const FunctionParser &)=delete
 
FunctionParseroperator= (const FunctionParser &)=delete
 

Static Public Member Functions

static SVX_DLLPUBLIC std::shared_ptr< ExpressionNode > const & parseFunction (const OUString &rFunction, const EnhancedCustomShape2d &rCustoShape)
 Parse a string. More...
 

Detailed Description

Definition at line 177 of file EnhancedCustomShapeFunctionParser.hxx.

Constructor & Destructor Documentation

EnhancedCustomShape::FunctionParser::FunctionParser ( )
delete
EnhancedCustomShape::FunctionParser::FunctionParser ( const FunctionParser )
delete

Member Function Documentation

FunctionParser& EnhancedCustomShape::FunctionParser::operator= ( const FunctionParser )
delete
std::shared_ptr< ExpressionNode > const & EnhancedCustomShape::FunctionParser::parseFunction ( const OUString &  rFunction,
const EnhancedCustomShape2d rCustoShape 
)
static

Parse a string.

The following grammar is accepted by this method:

number_digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'

number = number number_digit | number_digit

identifier = 'pi'|'left'|'top'|'right'|'bottom'|'xstretch'|'ystretch'| 'hasstroke'|'hasfill'|'width'|'height'|'logwidth'|'logheight'

unary_function = 'abs'|'sqrt'|'sin'|'cos'|'tan'|'atan' binary_function = 'min'|'max'|'atan2' ternary_function = 'if'

function_reference = '?' 'a-z,A-Z,0-9' ' ' modifier_reference = '$' '0-9' ' '

basic_expression = number | identifier | function_reference | unary_function '(' additive_expression ')' | binary_function '(' additive_expression ',' additive_expression ')' | ternary_function '(' additive_expression ',' additive_expression ', ' additive_expression ')' | '(' additive_expression ')'

unary_expression = '-' basic_expression

multiplicative_expression = basic_expression | multiplicative_expression '*' basic_expression | multiplicative_expression '/' basic_expression

additive_expression = multiplicative_expression | additive_expression '+' multiplicative_expression | additive_expression '-' multiplicative_expression

Parameters
rFunctionThe string to parse
rCustoShapeThe CustomShape is required for calculation of dynamic values such "hasstroke", function references and or modifier references ...
Exceptions
ParseErrorif an invalid expression is given.
Returns
the generated function object.

Definition at line 1123 of file EnhancedCustomShapeFunctionParser.cxx.

References OUStringToOString().

Referenced by EnhancedCustomShape2d::EnhancedCustomShape2d().


The documentation for this class was generated from the following files: