Package org.codehaus.commons.compiler

Examples of org.codehaus.commons.compiler.Location


  private class DiagListener implements DiagnosticListener<JavaFileObject> {
    @Override
    public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
      System.err.println("*** " + diagnostic.toString() + " *** " + diagnostic.getCode());

      Location loc = new Location( //
          diagnostic.getSource().toString(), //
          (short) diagnostic.getLineNumber(), //
          (short) diagnostic.getColumnNumber() //
      );
      String code = diagnostic.getCode();
View Full Code Here


                {
                    if (this.docComment != null) {
                        this.warning(
                            "MDC",
                            "Multiple doc comments",
                            new Location(this.optionalFileName, this.nextCharLineNumber, this.nextCharColumnNumber)
                        );
                    }
                    dcsb = new StringBuffer();
                    dcsb.append((char) this.nextChar);
                    state = (
View Full Code Here

            this.columnNumber     = Scanner.this.tokenColumnNumber;
        }

        public Location getLocation() {
            if (this.location == null) {
                this.location = new Location(this.optionalFileName, this.lineNumber, this.columnNumber);
            }
            return this.location;
        }
View Full Code Here

            this.getTargetIClass(qtr)                  // targetIClass
        );
        return this.getTargetIClass(qtr);
    }
    private IClass compileGet2(Java.ClassLiteral cl) throws CompileException {
        Location loc = cl.getLocation();
        final IClassLoader icl = this.iClassLoader;
        IClass iClass = this.getType(cl.type);

        if (iClass.isPrimitive()) {
View Full Code Here

        IClass[] pts = iConstructor.getParameterTypes();

        // Determine formal parameters of anonymous constructor.
        Java.FunctionDeclarator.FormalParameter[] fps;
        Location loc = naci.getLocation();
        {
            List l = new ArrayList(); // FormalParameter

            // Pass the enclosing instance of the base class as parameter #1.
            if (naci.optionalQualification != null) l.add(new Java.FunctionDeclarator.FormalParameter(
View Full Code Here

        //       } catch (java.lang.ClassNotFoundException e) {
        //           throw new java.lang.NoClassDefFoundError(e.getMessage());
        //       }
        //   }
        //
        Location loc = cl.getLocation();
        Java.AbstractTypeDeclaration declaringType;
        for (Java.Scope s = cl.getEnclosingBlockStatement();; s = s.getEnclosingScope()) {
            if (s instanceof Java.AbstractTypeDeclaration) {
                declaringType = (Java.AbstractTypeDeclaration) s;
                break;
View Full Code Here

  @Override
  public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
    if (diagnostic.getKind() == javax.tools.Diagnostic.Kind.ERROR) {
      String message = diagnostic.toString() + " (" + diagnostic.getCode() + ")";
      logger.error(message);
      Location loc = new Location( //
          diagnostic.getSource().toString(), //
          (short) diagnostic.getLineNumber(), //
          (short) diagnostic.getColumnNumber() //
      );
      // Wrap the exception in a RuntimeException, because "report()"
View Full Code Here

     *   PackageDeclaration := 'package' QualifiedIdentifier ';'
     * </pre>
     */
    public Java.PackageDeclaration parsePackageDeclaration() throws CompileException, IOException {
        this.readKeyword("package");
        Location loc = this.location();
        String packageName = Parser.join(this.parseQualifiedIdentifier(), ".");
        this.readOperator(";");
        this.verifyStringIsConventionalPackageName(packageName, loc);
        return new Java.PackageDeclaration(loc, packageName);
    }
View Full Code Here

     * <pre>
     *   ImportDeclarationBody := [ 'static' ] Identifier { '.' Identifier } [ '.' '*' ]
     * </pre>
     */
    public Java.CompilationUnit.ImportDeclaration parseImportDeclarationBody() throws CompileException, IOException {
        Location loc = this.location();
        boolean isStatic;
        if (this.peekKeyword("static")) {
            isStatic = true;
            this.eatToken();
        } else
View Full Code Here

    public Java.NamedClassDeclaration parseClassDeclarationRest(
        String                  optionalDocComment,
        short                   modifiers,
        ClassDeclarationContext context
    ) throws CompileException, IOException {
        Location location = this.location();
        String className = this.readIdentifier();
        this.verifyIdentifierIsConventionalClassOrInterfaceName(className, location);

        Java.ReferenceType optionalExtendedType = null;
        if (this.peekKeyword("extends")) {
View Full Code Here

TOP

Related Classes of org.codehaus.commons.compiler.Location

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.