com.wewebu.expression.language
Class OwExprArgumentsSuffix

java.lang.Object
  extended by com.wewebu.expression.language.OwExprExpression
      extended by com.wewebu.expression.language.OwExprArgumentsSuffix
All Implemented Interfaces:
OwExprPrimaryPrefix

public class OwExprArgumentsSuffix
extends OwExprExpression
implements OwExprPrimaryPrefix

An function arguments suffix of a primary expression.
In the expression function(2,3,'sss') the (2,3,'sss') arguments will be parsed into an OwExprArgumentsSuffix. At evaluation time the function function symbol will be used to perform a function call with the designated arguments.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Field Summary
 
Fields inherited from class com.wewebu.expression.language.OwExprExpression
m_errorTable, m_symbolTable, m_typeError
 
Constructor Summary
OwExprArgumentsSuffix(OwExprSymbolTable symbolTable_p, OwExprErrorTable errorTable_p, OwExprPrimaryPrefix prefix_p, List argumentsExpressions_p)
          Constructor
 
Method Summary
 OwExprValue evaluate(OwExprScope scope_p)
          Evaluates this expression on the OwExprScope (scope) provided as argument.
 OwExprExpression expression()
          The prefix of this expression is forced to function.
 OwExprFunctionSymbol regressToFunction()
          Function on function call is not allowed.
(egg.
 OwExprPropertySymbol regressToPorperty()
          Function on property call is not allowed.
 OwExprSymbolScope regressToScope()
          Forces this primary prefix to a scope symbol.
It also forces the m_prefix primary prefix to a function call.
 String toString()
           
 OwExprExpressionType type()
          Type check method.The type of the function symbol is considered - m_functionSymbol.
 
Methods inherited from class com.wewebu.expression.language.OwExprExpression
errCount, evaluate, evaluate, getErrorTable, getSymbol, getSymbolTable, hasErrors, initType, symbolsVisibleInScopes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OwExprArgumentsSuffix

public OwExprArgumentsSuffix(OwExprSymbolTable symbolTable_p,
                             OwExprErrorTable errorTable_p,
                             OwExprPrimaryPrefix prefix_p,
                             List argumentsExpressions_p)
Constructor

Parameters:
symbolTable_p - global symbol table
errorTable_p - global error table
prefix_p - the primary prefix
argumentsExpressions_p - list of arguments as OwExprExpressions
Method Detail

evaluate

public OwExprValue evaluate(OwExprScope scope_p)
                     throws OwExprEvaluationException
Evaluates this expression on the OwExprScope (scope) provided as argument.
First the arguments are evaluated.
Than the function value is obtained using OwExprFunctionSymbol.getValue(OwExprScope, OwExprValue[])

Specified by:
evaluate in class OwExprExpression
Parameters:
scope_p - scope to be used during evaluation
Returns:
the value resulted from the evaluation of this function
Throws:
OwExprEvaluationException

type

public OwExprExpressionType type()
                          throws OwExprTypeMissmatchException
Type check method.The type of the function symbol is considered - m_functionSymbol. If type errors are encountered during type computation the OwExprExpression.m_typeError should be set to true

Specified by:
type in class OwExprExpression
Returns:
the expression type for this expression
Throws:
OwExprTypeMissmatchException - if type errors are ecountrede during type computation

expression

public OwExprExpression expression()
The prefix of this expression is forced to function.

Specified by:
expression in interface OwExprPrimaryPrefix
Returns:
the expression represented by this primary prefix

regressToFunction

public OwExprFunctionSymbol regressToFunction()
                                       throws OwExprTypeMissmatchException
Function on function call is not allowed.
(egg. aFunction(1,2)(3,4)).

Specified by:
regressToFunction in interface OwExprPrimaryPrefix
Returns:
the function symbol of this expression
Throws:
OwExprTypeMissmatchException - always

regressToPorperty

public OwExprPropertySymbol regressToPorperty()
                                       throws OwExprTypeMissmatchException
Function on property call is not allowed.
(egg. aFunction.(1,2)).

Specified by:
regressToPorperty in interface OwExprPrimaryPrefix
Returns:
the property symbol of this expression
Throws:
OwExprTypeMissmatchException - always

regressToScope

public OwExprSymbolScope regressToScope()
                                 throws OwExprTypeMissmatchException
Forces this primary prefix to a scope symbol.
It also forces the m_prefix primary prefix to a function call. (egg. aFunction(1,2).aProperty)

Specified by:
regressToScope in interface OwExprPrimaryPrefix
Returns:
the scope symbol of this function expression
Throws:
OwExprTypeMissmatchException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.