Package org.eclipse.dltk.ast.declarations

Examples of org.eclipse.dltk.ast.declarations.ModuleDeclaration


   */
  public static String extractNamespaceName(String elementName,
      ISourceModule sourceModule, final int offset) {

    // Check class name aliasing:
    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(sourceModule);
    UsePart usePart = ASTUtils.findUseStatementByAlias(moduleDeclaration,
        elementName, offset);
    if (usePart != null) {
      elementName = usePart.getNamespace().getFullyQualifiedName();
View Full Code Here


    if (field == null) {
      return null;
    }
    try {
      ISourceModule sourceModule = field.getSourceModule();
      ModuleDeclaration moduleDeclaration = SourceParserUtil
          .getModuleDeclaration(sourceModule);
      ASTNode fieldDeclaration = PHPModelUtils.getNodeByField(
          moduleDeclaration, field);
      if (fieldDeclaration instanceof IPHPDocAwareDeclaration) {
        return ((IPHPDocAwareDeclaration) fieldDeclaration).getPHPDoc();
View Full Code Here

    if (method == null) {
      return null;
    }
    try {
      ISourceModule sourceModule = method.getSourceModule();
      ModuleDeclaration moduleDeclaration = SourceParserUtil
          .getModuleDeclaration(sourceModule);
      MethodDeclaration methodDeclaration = PHPModelUtils
          .getNodeByMethod(moduleDeclaration, method);
      if (methodDeclaration instanceof IPHPDocAwareDeclaration) {
        return ((IPHPDocAwareDeclaration) methodDeclaration)
View Full Code Here

    if (type == null) {
      return null;
    }
    try {
      ISourceModule sourceModule = type.getSourceModule();
      ModuleDeclaration moduleDeclaration = SourceParserUtil
          .getModuleDeclaration(sourceModule);
      TypeDeclaration typeDeclaration = PHPModelUtils.getNodeByClass(
          moduleDeclaration, type);
      if (typeDeclaration instanceof IPHPDocAwareDeclaration) {
        return ((IPHPDocAwareDeclaration) typeDeclaration).getPHPDoc();
View Full Code Here

    try {
      getMethodFields(method, prefix, exactName, elements, processedVars);

      // collect global variables
      ModuleDeclaration rootNode = SourceParserUtil
          .getModuleDeclaration(method.getSourceModule());
      MethodDeclaration methodDeclaration = PHPModelUtils
          .getNodeByMethod(rootNode, method);
      if (methodDeclaration != null) {
        methodDeclaration.traverse(new ASTVisitor() {
View Full Code Here

  }

  public static IModelElement[] getTypeInString(ISourceModule sourceModule,
      IRegion wordRegion) {
    IModelElement[] elements = null;
    ModuleDeclaration parsedUnit = SourceParserUtil.getModuleDeclaration(
        sourceModule, null);

    ASTNode node = ASTUtils.findMinimalNode(parsedUnit,
        wordRegion.getOffset(),
        wordRegion.getOffset() + wordRegion.getLength());
View Full Code Here

          replaceRange.getLength() + 1);
    }
    CompletionRequestor requestor = arrayContext.getCompletionRequestor();

    String prefix = arrayContext.getPrefix();
    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(arrayContext.getSourceModule());
    try {
      ArrayKeyFinder finder = new ArrayKeyFinder(prefix,
          arrayContext.getOffset());
      moduleDeclaration.traverse(finder);
      Set<String> names = finder.getNames();
      int extraObject = ProposalExtraInfo.DEFAULT;
      if (!arrayContext.hasQuotes()) {
        extraObject |= ProposalExtraInfo.ADD_QUOTES;
      }
View Full Code Here

public class PhpIndexingParser implements IIndexingParser {

  public void parseSourceModule(ISourceModule module,
      IIndexingRequestor requestor) {

    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(module);
    if (moduleDeclaration != null) {
      try {
        moduleDeclaration.traverse(new PhpIndexingVisitor(requestor, module));
      } catch (Exception e) {
        if (DLTKCore.DEBUG) {
          e.printStackTrace();
        }
      }
View Full Code Here

  }

  public IEvaluatedType[] getFunctionReturnType(IMethod functionElement) {

    ISourceModule sourceModule = functionElement.getSourceModule();
    ModuleDeclaration sourceModuleDeclaration = SourceParserUtil
        .getModuleDeclaration(sourceModule);
    MethodDeclaration functionDeclaration = null;
    try {
      functionDeclaration = PHPModelUtils.getNodeByMethod(
          sourceModuleDeclaration, functionElement);
View Full Code Here

      int offset) {
    if (types != null) {
      for (IType type : types) {
        PHPClassType classType = PHPClassType.fromIType(type);

        ModuleDeclaration moduleDeclaration = SourceParserUtil
            .getModuleDeclaration(type.getSourceModule(), null);
        FileContext fileContext = new FileContext(
            type.getSourceModule(), moduleDeclaration, offset);
        TypeContext typeContext = new TypeContext(fileContext,
            classType);
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.ast.declarations.ModuleDeclaration

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.