Package org.openquark.cal.internal.javamodel

Examples of org.openquark.cal.internal.javamodel.JavaTypeName


                    maxTypeNameLength = nameLength;
                }
            }
           
            for (QualifiedName typeName : userDefined_typeToClassMappings.keySet()) {
                JavaTypeName jtn = userDefined_typeToClassMappings.get(typeName);
               
                StringBuffer sb = new StringBuffer();
                sb.append (typeName.toSourceText());
                for (int i = sb.length(); i < maxTypeNameLength; ++i) {
                    sb.append (" ");
                }
               
                sb.append (" => ");
                sb.append (jtn.getFullJavaSourceName());
                getIceLogger().log(Level.INFO, sb.toString());
            }           
        } else {
            // A mapping is either being added or removed.
           
View Full Code Here


         * @see org.openquark.cal.internal.machine.lecc.JavaModelVisitor#visitLocalNameExpression(org.openquark.cal.internal.machine.lecc.JavaExpression.LocalName, java.lang.Object)
         */
        public JavaExpression visitLocalNameExpression(LocalName localName, Void arg) {
            // If we've gotten to this point the LocalName may be a reference that needs to be nulled out.
            if (shouldRelease(localName.getName())) {
                JavaTypeName varType = variablesOfInterest.get(localName.getName());
                variablesOfInterest.remove(localName.getName());
                return callLastRef (localName, localName, varType);
            } else {
                return super.visitLocalNameExpression(localName, arg);
            }
View Full Code Here

         */
        public JavaExpression visitLocalVariableExpression(LocalVariable localVariable,
                Void arg) {
            // If we've gotten to this point the LocalVariable may be a reference that needs to be nulled out.
            if (shouldRelease(localVariable.getName())) {
                JavaTypeName varType = variablesOfInterest.get(localVariable.getName());
                variablesOfInterest.remove(localVariable.getName());
                return callLastRef (localVariable, localVariable, varType);
            } else {
                return super.visitLocalVariableExpression(localVariable, arg);
            }
View Full Code Here

         */
        public JavaExpression visitMethodVariableExpression(MethodVariable methodVariable,
                Void arg) {
            // If we've gotten to this point the LocalVariable may be a reference that needs to be nulled out.
            if (shouldRelease(methodVariable.getName())) {
                JavaTypeName varType = variablesOfInterest.get(methodVariable.getName());
                variablesOfInterest.remove(methodVariable.getName());
                return callLastRef (methodVariable, methodVariable, varType);
            } else {
                return super.visitMethodVariableExpression(methodVariable, arg);
            }
View Full Code Here

                        argTypes,
                        instanceInvocation.getReturnType(),
                        instanceInvocation.getInvocationType());

                if (shouldRelease(varName)) {
                    JavaTypeName varType = variablesOfInterest.get(varName);
                    variablesOfInterest.remove(varName);
                    return callLastRef(newInvocation, evaluateTarget, varType);
                }

                return newInvocation;
View Full Code Here

                }
            }

            int classModifiers = Modifier.ABSTRACT | Modifier.PUBLIC;

            JavaTypeName superClassTypeName = JavaTypeNames.RTCONS;

            // No interfaces are implemented
            JavaTypeName[] interfaces = JavaDefinitionBuilder.EMPTY_TYPE_NAME_ARRAY;

            this.javaClassRep = new JavaClassRep(className, superClassTypeName, classModifiers, interfaces);
View Full Code Here

                }

                HashSet<FieldName> set = new LinkedHashSet<FieldName>();
                for (final FieldName fn : commonFieldNames) {
                    int index = dc.getFieldIndex(fn);
                    JavaTypeName jt = fieldNameToType.get(fn);
                    boolean fs = fieldNameToStrictness.get(fn).booleanValue();

                    if (fs == fieldStrictness[index] &&
                            SCJavaDefn.typeExprToTypeName(fieldTypes[index]).equals(jt)) {
                        set.add(fn);
View Full Code Here

        /**
         * Create a static final field for each zero arity DC.
         */
        private void createFields_tagDCs () {
            JavaTypeName tagDCTypeName = CALToJavaNames.createTypeNameForTagDCFromType(typeConstructor, module);
            int fieldModifiers = Modifier.PRIVATE | Modifier.STATIC | Modifier.FINAL;
            for (final DataConstructor dc : dataConsList) {
                if (dc.getArity() == 0) {
                    JavaExpression initializer = new ClassInstanceCreationExpression(tagDCTypeName, LiteralWrapper.make(Integer.valueOf(dc.getOrdinal())), JavaTypeName.INT);
                    String fieldName = CALToJavaNames.fixupVarName(dc.getName().getUnqualifiedName());
View Full Code Here

            for (final FieldName fn : fieldNames) {
                boolean strict = fieldNameToStrictness.get(fn).booleanValue();
                if (!strict) {
                    continue;
                }
                JavaTypeName type = fieldNameToType.get(fn);
                String fieldName = SCJavaDefn.getJavaFieldNameFromFieldName(fn);

                JavaExpression assign = new JavaExpression.Assignment(new JavaField.Instance(null, fieldName, type), getDefaultValueForType(type));
                constructor.addStatement(new ExpressionStatement(assign));
            }
View Full Code Here

            Block constructorBody = new Block();

            int i = 0;
            for (final FieldName fn : fieldNames) {
                boolean strict = fieldNameToStrictness.get(fn).booleanValue();
                JavaTypeName type = JavaTypeNames.RTVALUE;
                if (strict) {
                    type = fieldNameToType.get(fn);
                }
                String fieldName = SCJavaDefn.getJavaFieldNameFromFieldName(fn);
                String argName = fieldName+"$";
View Full Code Here

TOP

Related Classes of org.openquark.cal.internal.javamodel.JavaTypeName

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.