Package com.googlecode.goclipse.go.lang.model

Examples of com.googlecode.goclipse.go.lang.model.Import


     
      // imported function call or method call
      if (word.contains(".")) {
       
        String[] parts = word.split("\\.");
        Import   i     = cc1.getImportForName(parts[0]);
       
        if (i != null) {
       
          Node node = cc1.getLocationForPkgAndName(i.path, parts[1]);
          if (node == null) {
View Full Code Here


      switch (state) {
      case IGNORING:
        if (TokenType.IMPORT.equals(type)) {
          state = State.DETERMINING;
          currentImport = new Import();
          currentImport.setFile(file);
        }
        break;
      case DETERMINING:
        if (TokenType.LPAREN.equals(type)) {
          state = State.MULTIPLE;
        }
        else if (TokenType.QUOTE.equals(type)) {
          state = State.SINGLE;
          currentImport.prefixType = Import.PrefixType.NONE;
        }
        else if (TokenType.PERIOD.equals(type)) {
          if (currentImport != null) {
            currentImport.prefixType = Import.PrefixType.INCLUDED;
          }
        }
        else if (TokenType.IDENTIFIER.equals(type)) {
          if (currentImport != null) {
            currentImport.prefixType = Import.PrefixType.ALIAS;
            currentImport.prefix = value;
          }
        }
        break;
      case SINGLE:
        if (TokenType.QUOTE.equals(type)) {
          imports.add(currentImport);
          currentImport = null;
         
          state = State.IGNORING;
        } else {
          currentImport.path += value;
          currentImport.setLine(linenumber);
        }
        break;
      case MULTIPLE:
        if (currentImport == null) {
          currentImport = new Import();
          currentImport.setFile(file);
        }

        if (TokenType.QUOTE.equals(type)) {
          reading = !reading;
View Full Code Here

          fileScope.setStart(Integer.parseInt(attributes.getValue(LINE)));
          fileScope.setEnd(Integer.parseInt(attributes.getValue(ENDLINE)));
          activeNode = fileScope;
        } else if (IMPORT.equals(qName)) {
          System.out.println(IMPORT);
          Import imp = new Import();
          imp.setLine(Integer.parseInt(attributes.getValue(LINE)));
          imp.setInsertionText(attributes.getValue(NAME));
          imp.setName(attributes.getValue(PATH));
          fileScope.addImport(imp);
        } else if (VAR.equals(qName)) {
          Var var = new Var();
          var.setInsertionText(attributes.getValue(NAME));
          var.setLine(Integer.parseInt(attributes.getValue(LINE)));
View Full Code Here

TOP

Related Classes of com.googlecode.goclipse.go.lang.model.Import

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.