⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 constantpoolnames.jrag

📁 JDK1.4编译器后端
💻 JRAG
字号:
/* * The JastAdd Extensible Java Compiler (http://jastadd.org) is covered * by the modified BSD License. You should have received a copy of the * modified BSD license with this compiler. *  * Copyright (c) 2005-2008, Torbjorn Ekman * All rights reserved. */aspect ConstantPoolNames {  syn lazy String TypeDecl.typeDescriptor() {    throw new Error("Can not compute typeDescriptor for " + getClass().getName());  }  eq ClassDecl.typeDescriptor() = "L" + constantPoolName() + ";";  eq InterfaceDecl.typeDescriptor() = "L" + constantPoolName() + ";";  eq BooleanType.typeDescriptor() = "Z";  eq    ByteType.typeDescriptor() = "B";  eq   ShortType.typeDescriptor() = "S";  eq     IntType.typeDescriptor() = "I";  eq    LongType.typeDescriptor() = "J";  eq    CharType.typeDescriptor() = "C";  eq   FloatType.typeDescriptor() = "F";  eq  DoubleType.typeDescriptor() = "D";  eq    VoidType.typeDescriptor() = "V";  eq   ArrayDecl.typeDescriptor() {     StringBuffer dim = new StringBuffer();    for(int i = 0; i < dimension(); i++)      dim.append("[");    return dim.toString() + elementType().typeDescriptor();   }  eq UnknownType.typeDescriptor() { throw new Error("Trying to make a typeDescriptor() of Unknown"); }  syn lazy String MethodDecl.descName() {    StringBuffer b = new StringBuffer();    b.append("(");    for (int i=0; i<getNumParameter(); i++)      b.append(getParameter(i).type().typeDescriptor());    b.append(")");    if(type().elementType().isUnknown()) {      System.out.println(getTypeAccess().dumpTree());      throw new Error("Error generating descName for " + signature() + ", did not expect unknown return type");    }    b.append(type().typeDescriptor());    return b.toString();  }  syn lazy String ConstructorDecl.descName() {    StringBuffer b = new StringBuffer();    b.append("(");    // this$0    if(needsEnclosing())      b.append(enclosing().typeDescriptor());    if(needsSuperEnclosing())      b.append(superEnclosing().typeDescriptor());    // args    for (int i=0; i<getNumParameter(); i++)      b.append(getParameter(i).type().typeDescriptor());    b.append(")V");    return b.toString();  }  inh lazy String TypeDecl.destinationPath();  eq CompilationUnit.getTypeDecl(int index).destinationPath() = destinationPath();  eq CompilationUnit.getImportDecl(int index).destinationPath() = destinationPath();  syn lazy String CompilationUnit.destinationPath() {    if(Program.hasValueForOption("-d")) {      return Program.getValueForOption("-d");    }    else {      if(fromSource()) {        // /home/torbjorn/sandbox/JavaCompiler/JCK/javasoft/sqe/tests/lang/icls045/icls04591m11/icls04591m11_c.java        // package javasoft.sqe.tests.lang.icls045.icls04591m11_p class icls04591m11_c        // /home/torbjorn/sandbox/JavaCompiler/JCK/javasoft/sqe/tests/lang/icls045/icls04591m11/icls04591m11.java        // package javasoft.sqe.tests.lang.icls045.icls04591m11 class icls04591m11        // ta paketnamnet p och om det har fler 鋘 3 delar s

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -