/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Batch file parser, this needs more work.
*
* WARNING: The contents of this source file are not part of any
* supported API. Code that depends on them does so at its own risk:
* they are subject to change or removal without notice.
*/
public
/**
* The current package
*/
/**
* The current imports
*/
/**
* The classes defined in this file
*/
/**
* The current class
*/
/**
* The toplevel environment
*/
/**
* Create a batch file parser
*/
}
/**
* Package declaration
*/
//System.out.println("package " + nm);
// This code has been changed to pass an IdentifierToken,
// rather than an Identifier, to setCurrentPackage(). Imports
// now needs the location of the token.
} else {
}
}
/**
* Import class
*/
//System.out.println("import class " + t);
}
/**
* Import package
*/
//System.out.println("import package " + t);
imports.addPackage(t);
}
/**
* Define class
*/
// If this class is nested, the modifier bits set here will
// be copied into the 'SourceMember' object for the inner class
// created during the call to 'makeClassDefinition' below.
// When writing the class file, we will look there for the
// 'untransformed' modifiers. The modifiers in the ClassDefinition
// object will end up as the 'transformed' modifiers. Note that
// there are some bits set here that are not legal class modifiers
// according to the JVMS, e.g., M_PRIVATE and M_STATIC. These are
// masked off while writing the class file, but are preserved in
// the InnerClasses attributes.
t = new IdentifierToken(t.getWhere(),
}
// The defaults for anonymous and local classes should be documented!
}
}
// Certain modifiers are implied as follows:
//
// 1. Any interface (nested or not) is implicitly deemed to be abstract,
// whether it is explicitly marked so or not. (Java 1.0.)
// 2. A interface which is a member of a type is implicitly deemed to
// be static, whether it is explicitly marked so or not. (InnerClasses)
// 3a. A type which is a member of an interface is implicitly deemed
// to be public, whether it is explicitly marked so or not. (InnerClasses)
// 3b. A type which is a member of an interface is implicitly deemed
// to be static, whether it is explicitly marked so or not. (InnerClasses)
// Rule 1.
mod |= M_ABSTRACT;
if (outerClass != null) {
// Rule 2.
}
}
// Rule 3a.
// For interface members, neither 'private' nor 'protected'
// are legal modifiers. We avoid setting M_PUBLIC in some
// cases in order to avoid interfering with error detection
// and reporting. This is patched up, after reporting an
// error, by 'SourceClass.addMember'.
// Rule 3b.
}
// For nested classes, we must transform 'protected' to 'public'
// and 'private' to package scope. This must be done later,
// because any modifiers set here will be copied into the
// 'MemberDefinition' for the nested class, which must represent
// the original untransformed modifiers. Also, compile-time
// checks should be performed against the actual, untransformed
// modifiers. This is in contrast to transformations that implement
// implicit modifiers, such as M_STATIC and M_FINAL for fields
// of interfaces.
// The code which adds artificial dependencies between
// classes in the same source file has been moved to
// BatchEnvironment#parseFile().
return sourceClass;
}
/**
* Report the current class under construction.
*/
return sourceClass;
}
/**
* End class
*/
// c == sourceClass; don't bother to check
env = toplevelEnv;
if (sourceClass != null)
}
/**
* Define a method
*/
// c == sourceClass; don't bother to check
// Members that are nested classes are not created with 'defineField',
// so these transformations do not apply to them. See 'beginClass' above.
if (sourceClass.isInterface()) {
// Members of interfaces are implicitly public.
// For interface members, neither 'private' nor 'protected'
// are legal modifiers. Avoid setting M_PUBLIC in some cases
// to avoid interfering with later error detection. This will
// be fixed up after the error is reported.
// Methods of interfaces are implicitly abstract.
// Fields of interfaces are implicitly static and final.
mod |= M_ABSTRACT;
} else {
}
}
// The parser reports "idInit" when in reality it has found
// that there is no method name at all present.
// So, decide if it's really a constructor, or a syntax error.
: rt.getClassName();
// It appears to be a constructor with spurious qualification.
// It appears to be a type name with no method name.
return;
} else {
// We assume the type name is missing, even though the
// simple name that's present might have been intended
// to be a type: "String (){}" vs. "toString(){}".
return;
}
}
}
}
}
}
}