Package org.eclipse.dltk.ast.declarations

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


              protected void runTest() throws Throwable {

                ByteArrayInputStream inputStream = new ByteArrayInputStream(
                    pdttFile.getFile().trim().getBytes());
                ModuleDeclaration moduleDeclaration = (ModuleDeclaration) parser
                    .parse(new InputStreamReader(
                        inputStream),
                        null,
                        ProjectOptions
                            .useShortTags((IProject) null));
View Full Code Here


  public static UseTrait parse(IType type) {
    final UseTrait useTrait = new UseTrait();
    final ISourceModule sourceModule = type.getSourceModule();
    try {
      final ISourceRange sourceRange = type.getSourceRange();
      ModuleDeclaration moduleDeclaration = SourceParserUtil
          .getModuleDeclaration(sourceModule);
      moduleDeclaration.traverse(new TraitUseStatementVisitor() {
        @Override
        public boolean visit(TraitUseStatement s) throws Exception {
          if (s.sourceStart() > sourceRange.getOffset()
              && s.sourceEnd() < sourceRange.getOffset()
                  + sourceRange.getLength()) {
View Full Code Here

    int methodEnd = PHPTextSequenceUtilities.getMethodEndIndex(source, end);
    if (methodEnd != -1) {
      end = methodEnd;
    }

    ModuleDeclaration parsedUnit = SourceParserUtil.getModuleDeclaration(
        sourceModule, null);

    // boolean inDocBlock=false;
    if (parsedUnit instanceof PHPModuleDeclaration) {
      PHPModuleDeclaration phpModuleDeclaration = (PHPModuleDeclaration) parsedUnit;
View Full Code Here

        types.toArray(new IEvaluatedType[types.size()]));
  }

  public static IEvaluatedType resolveExpression(ISourceModule sourceModule,
      ASTNode expression) {
    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(sourceModule);
    IContext context = ASTUtils.findContext(sourceModule,
        moduleDeclaration, expression);
    return resolveExpression(sourceModule, moduleDeclaration, context,
        expression);
View Full Code Here

      if (prefix.indexOf(NamespaceReference.NAMESPACE_SEPARATOR) < 0) {
        IModuleSource module = reporter.getModule();
        org.eclipse.dltk.core.ISourceModule sourceModule = (org.eclipse.dltk.core.ISourceModule) module
            .getModelElement();
        ModuleDeclaration moduleDeclaration = SourceParserUtil
            .getModuleDeclaration(sourceModule);
        final int offset = abstractContext.getOffset();
        IType namespace = PHPModelUtils.getCurrentNamespace(
            sourceModule, offset);
View Full Code Here

        }
      }

      IType[] types = getLhsTypes();
      if (types != null && types.length > 0) {
        ModuleDeclaration moduleDeclaration = SourceParserUtil
            .getModuleDeclaration(sourceModule);
        if (moduleDeclaration != null) {
          IContext context = ASTUtils.findContext(sourceModule,
              moduleDeclaration, offset);
          if (context instanceof MethodContext) {
View Full Code Here

  public void build(IBuildContext context) throws CoreException {
    // Current file is being built:
    ISourceModule sourceModule = context.getSourceModule();
    // Get file AST:
    ModuleDeclaration moduleDeclaration = SourceParserUtil.getModuleDeclaration(sourceModule);
    // Run the validation visitor:
    try {
      moduleDeclaration.traverse(new XSSValidationVisitor(context));
    } catch (Exception e) {
      throw new CoreException(new Status(
        IStatus.ERROR, XSSPlugin.PLUGIN_ID, "An error has occurred while invoking XSS validator", e));
    }
  }
View Full Code Here

    String prefix = gotoStatementContext.getPrefix();
    if (prefix.startsWith("$")) { //$NON-NLS-1$
      return;
    }
    try {
      ModuleDeclaration rootNode = SourceParserUtil
          .getModuleDeclaration(gotoStatementContext
              .getSourceModule());
      ASTNode node;
      if (gotoStatementContext.getCurrentElement() != null) {
        node = PHPModelUtils.getNodeByElement(rootNode,
View Full Code Here

   */
  public static PHPClassType fromTypeName(String typeName,
      ISourceModule sourceModule, int offset) {
    String namespace = PHPModelUtils.extractNamespaceName(typeName,
        sourceModule, offset);
    final ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(sourceModule);
    if (PHPModelUtils.isInUseTraitStatement(moduleDeclaration, offset)) {

      if (namespace != null) {
        return new PHPTraitType(namespace,
View Full Code Here

  public static String getRealName(String elementName,
      ISourceModule sourceModule, final int offset,
      String defaultClassName) {

    // 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

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.