Package org.openquark.cal.internal.javamodel.JavaExpression

Examples of org.openquark.cal.internal.javamodel.JavaExpression.InstanceOf


    /* (non-Javadoc)
     * @see org.openquark.cal.internal.runtime.lecc.JavaModelVisitor#visitInstanceOfExpression(org.openquark.cal.internal.runtime.lecc.JavaExpression.InstanceOf, java.lang.Object)
     */
    public JavaExpression visitInstanceOfExpression(InstanceOf instanceOf, T arg) {
        return new InstanceOf (
                (JavaExpression)instanceOf.getJavaExpression().accept(this, arg),
                instanceOf.getReferenceType());
    }
View Full Code Here


                        String localName = fieldName+"$";
                        LocalVariable localVariable = new LocalVariable(localName, fieldType);
                        LocalVariableDeclaration localDeclaration = new LocalVariableDeclaration(localVariable);
                        javaMethod.addStatement(localDeclaration);
                        Assignment localAssignment = new Assignment(localVariable, field);
                        InstanceOf checkType = new InstanceOf(localAssignment, JavaTypeNames.RTRESULT_FUNCTION);
                        MethodInvocation getValue = new MethodInvocation.Instance(localVariable, "getValue", JavaTypeNames.RTVALUE, MethodInvocation.InvocationType.VIRTUAL);
                        Assignment fieldAssignment = new Assignment(field, getValue);
                        ReturnStatement returnNewVal = new ReturnStatement(fieldAssignment);
                        IfThenElseStatement ifThen = new IfThenElseStatement(checkType, returnNewVal);
                        javaMethod.addStatement(ifThen);
View Full Code Here

                   String localName = javaFieldNames[i]+"$";
                   LocalVariable localVariable = new LocalVariable(localName, JavaTypeNames.RTVALUE);
                   LocalVariableDeclaration localDeclaration = new LocalVariableDeclaration(localVariable);
                   javaMethod.addStatement(localDeclaration);
                   Assignment localAssignment = new Assignment(localVariable, field);
                   InstanceOf checkType = new InstanceOf(localAssignment, JavaTypeNames.RTRESULT_FUNCTION);
                   MethodInvocation getValue = new MethodInvocation.Instance(localVariable, "getValue", JavaTypeNames.RTVALUE, MethodInvocation.InvocationType.VIRTUAL);
                   Assignment fieldAssignment = new Assignment(field, getValue);
                   ReturnStatement returnNewVal = new ReturnStatement(fieldAssignment);
                   IfThenElseStatement ifThen = new IfThenElseStatement(checkType, returnNewVal);
                   javaMethod.addStatement(ifThen);
View Full Code Here

TOP

Related Classes of org.openquark.cal.internal.javamodel.JavaExpression.InstanceOf

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.