com.wewebu.expression.language
Class OwExprArraySelectorSuffix

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

public class OwExprArraySelectorSuffix
extends OwExprExpression
implements OwExprPrimaryPrefix

An array selector suffix of a primary expression.
In the expression property[2] the [2] arguments will be parsed into an OwExprArraySelectorSuffix. At evaluation time the property property symbol will be used to perform an indexed property evaluation with the designated index.

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
OwExprArraySelectorSuffix(OwExprSymbolTable symbolTable_p, OwExprErrorTable errorTable_p, OwExprPrimaryPrefix prefix_p, OwExprExpression arraySelector_p)
          Constructor
 
Method Summary
 OwExprValue evaluate(OwExprScope scope_p)
          Evaluates this expression on the OwExprScope (scope) provided as argument.
 OwExprExpression expression()
           
 OwExprFunctionSymbol regressToFunction()
          Forces this primary prefix symbol to a function.
 OwExprPropertySymbol regressToPorperty()
          Forces this primary prefix symbol to a property.
 OwExprSymbolScope regressToScope()
          Forces this primary prefix to a scope symbol.
 String toString()
           
 OwExprExpressionType type()
          Type check method.
 
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

OwExprArraySelectorSuffix

public OwExprArraySelectorSuffix(OwExprSymbolTable symbolTable_p,
                                 OwExprErrorTable errorTable_p,
                                 OwExprPrimaryPrefix prefix_p,
                                 OwExprExpression arraySelector_p)
Constructor

Parameters:
symbolTable_p - global symbol table
errorTable_p - global error table
prefix_p - the primary prefix
arraySelector_p - array selector expression
Method Detail

evaluate

public final OwExprValue evaluate(OwExprScope scope_p)
                           throws OwExprEvaluationException
Evaluates this expression on the OwExprScope (scope) provided as argument.
First the prefix is solbed as an scope .
Than the selector expression is evaluated to a numeric value.
Than the indexed value is obtained using OwExprScope.at(int) indexed access method.

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
Description copied from class: OwExprExpression
Type check method. 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 encountered during type computation

expression

public OwExprExpression expression()
Specified by:
expression in interface OwExprPrimaryPrefix
Returns:
the expression represented by this primary prefix

regressToFunction

public OwExprFunctionSymbol regressToFunction()
                                       throws OwExprTypeMissmatchException
Description copied from interface: OwExprPrimaryPrefix
Forces this primary prefix symbol to a function.

Specified by:
regressToFunction in interface OwExprPrimaryPrefix
Returns:
the function symbol of this expression
Throws:
OwExprTypeMissmatchException - if a type mismatch is detected during function symbol creation

regressToPorperty

public OwExprPropertySymbol regressToPorperty()
                                       throws OwExprTypeMissmatchException
Description copied from interface: OwExprPrimaryPrefix
Forces this primary prefix symbol to a property.

Specified by:
regressToPorperty in interface OwExprPrimaryPrefix
Returns:
the property symbol of this expression
Throws:
OwExprTypeMissmatchException - if a type mismatch is detected during property symbol creation

regressToScope

public OwExprSymbolScope regressToScope()
                                 throws OwExprTypeMissmatchException
Description copied from interface: OwExprPrimaryPrefix
Forces this primary prefix to a scope symbol.

Specified by:
regressToScope in interface OwExprPrimaryPrefix
Returns:
the scope symbol of this expression
Throws:
OwExprTypeMissmatchException - if a type mismatch is detected during scope symbol creation

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.