Examples of IncludeHandler


Examples of org.apache.flex.compiler.internal.parsing.as.IncludeHandler

                {
                    final Workspace workspace = builder.getWorkspace();
                    final FlexProject project = builder.getProject();
                    final Collection<ICompilerProblem> problems = builder.getProblems();

                    final IncludeHandler includeHandler = new IncludeHandler(builder.getFileSpecificationGetter());
                    includeHandler.setProjectAndCompilationUnit(project, builder.getCompilationUnit());

                    final ScopedBlockNode node = ASParser.parseFragment2(
                            mxmlTextData.getCompilableText(),
                            sourcePath,
                            mxmlTextData.getCompilableTextStart(),
                            mxmlTextData.getCompilableTextLine() - 1,
                            mxmlTextData.getCompilableTextColumn() - 1,
                            problems,
                            workspace,
                            builder.getFileNode(),
                            containingScope,
                            project.getProjectConfigVariables(),
                            EnumSet.of(PostProcessStep.CALCULATE_OFFSETS, buildOrReconnect),
                            true, //follow includes
                            includeHandler
                            );
                    ((MXMLFileNode)ancestorFileNode).updateIncludeTreeLastModified(includeHandler.getLastModified());
                    nodes.add(node);
                }
            }
        }
        return nodes;
View Full Code Here

Examples of org.apache.flex.compiler.internal.parsing.as.IncludeHandler

                IFileSpecification sourceFileSpec = workspace.getFileSpecification(sourcePath);
                String scriptText = builder.readExternalFile(attribute, sourcePath);

                if (scriptText != null)
                {
                    final IncludeHandler includeHandler = new IncludeHandler(builder.getFileSpecificationGetter());
                    includeHandler.setProjectAndCompilationUnit(project, builder.getCompilationUnit());
                    includeHandler.enterFile(sourcePath);
                    final MXMLFileScope fileScope = builder.getFileScope();
                    final OffsetLookup offsetLookup = fileScope.getOffsetLookup();
                    assert offsetLookup != null : "Expected OffsetLookup on FileScope.";
                    final int[] absoluteOffset = offsetLookup.getAbsoluteOffset(sourcePath, 0);

                    final ScopedBlockNode fragment = ASParser.parseFragment2(
                            scriptText,
                            sourceFileSpec.getPath(),
                            absoluteOffset[0],
                            0,
                            0,
                            problems,
                            workspace,
                            builder.getFileNode(),
                            classScope,
                            project.getProjectConfigVariables(),
                            EnumSet.of(PostProcessStep.CALCULATE_OFFSETS, PostProcessStep.RECONNECT_DEFINITIONS),
                            true /* follow includes */,
                            includeHandler);

                    builder.getFileNode().updateIncludeTreeLastModified(includeHandler.getLastModified());

                    // Make the statements inside the script tag the children of this node.
                    int n = fragment.getChildCount();
                    asNodes = new IASNode[n];
                    for (int i = 0; i < n; i++)
View Full Code Here

Examples of org.apache.flex.compiler.internal.parsing.as.IncludeHandler

                        final int[] absoluteOffsets = offsetLookup.getAbsoluteOffset(sourcePath, localOffset);
                        final int absoluteOffset = absoluteOffsets[0];

                        // create an include handler and mock its state as if it is
                        // before parsing for scope building
                        final IncludeHandler includeHandler = IncludeHandler.createForASTBuilding(
                                builder.getFileSpecificationGetter(),
                                sourcePath,
                                localOffset,
                                absoluteOffset);

                        // parse and build AST
                        final EnumSet<PostProcessStep> postProcess = EnumSet.of(
                                PostProcessStep.CALCULATE_OFFSETS,
                                PostProcessStep.RECONNECT_DEFINITIONS);
                        final ScopedBlockNode node = ASParser.parseInlineScript(
                                builder.getFileNode(),
                                mxmlTextData,
                                builder.getProblems(),
                                classScope,
                                project.getProjectConfigVariables(),
                                includeHandler,
                                postProcess);
                        MXMLFileNode filenode = builder.getFileNode();
                        filenode.updateIncludeTreeLastModified(includeHandler.getLastModified());
                        assert node != null : "Expected node from ASParser.getScopesFromInlineScript().";
                        scriptNodes.add(node);
                    }
                }
            }
View Full Code Here

Examples of org.apache.flex.compiler.internal.parsing.as.IncludeHandler

        packageDefinition.setContainedScope(packageScope);
        fileScope.addDefinition(packageDefinition);
       
        problems = new LinkedList<ICompilerProblem>();

        includeHandler = new IncludeHandler(fileSpecGetter);
        includeHandler.setProjectAndCompilationUnit(project, compilationUnit);

        this.fileSpecGetter = fileSpecGetter;
        assert fileSpecGetter != null;
    }
View Full Code Here

Examples of org.apache.flex.compiler.internal.parsing.as.IncludeHandler

        this.fileSpecGetter = fileSpecGetter;
        this.fileSpec = fileSpec;
       
        setSourcePath(fileSpec.getPath());
       
        includeHandler = new IncludeHandler(fileSpecGetter);
        embedNodes = new LinkedList<IEmbedResolver>();
        requiredResourceBundles = new HashSet<String>();
        deferredFunctionNodes = new HashSet<FunctionNode>();
       
        // Create the implicit import nodes.
View Full Code Here

Examples of org.apache.flex.compiler.internal.parsing.as.IncludeHandler

        assert offsetLookup != null : "Expected OffsetLookup on FileScope.";
        final String filePath = getContainingFilePath();
        final int[] absoluteOffsets =
                offsetLookup.getAbsoluteOffset(filePath, startOffsetLocal);
        final int startOffsetAbsolute = absoluteOffsets[0];
        final IncludeHandler includeHandler =
                IncludeHandler.createForASTBuilding(builder.getFileSpecificationGetter(), filePath, startOffsetLocal, startOffsetAbsolute);
        includeHandler.setProjectAndCompilationUnit(project, builder.getCompilationUnit());
        final String scriptFragment = attribute.getRawValue();
        if (scriptFragment.isEmpty())
        {
            MXMLEmptyEventHandlerProblem problem = new MXMLEmptyEventHandlerProblem(attribute);
            problems.add(problem);
        }
        final ScopedBlockNode node = ASParser.parseFragment2(
                scriptFragment,
                filePath,
                0,
                attribute.getValueLine(),
                attribute.getValueColumn(),
                problems,
                workspace,
                builder.getFileNode(),
                scope,
                project.getProjectConfigVariables(),
                EnumSet.of(PostProcessStep.CALCULATE_OFFSETS, PostProcessStep.POPULATE_SCOPE),
                true, //follow includes
                includeHandler);
        builder.getFileNode().updateIncludeTreeLastModified(includeHandler.getLastModified());
        processHandlerCode(builder, Collections.singletonList(node));
    }
View Full Code Here

Examples of org.eclipse.help.internal.dynamic.IncludeHandler

        DocumentReader reader = new DocumentReader();
        handlers = new ProcessorHandler[] {
          new NormalizeHandler(),
          new LinkHandler(),
          new AnchorHandler(),
          new IncludeHandler(reader, contribution.getLocale()),
          new ExtensionHandler(reader, contribution.getLocale()),
        };
      }
      processor.setHandlers(handlers);
      processor.process((Toc)contribution.getToc(), contribution.getId());
View Full Code Here

Examples of org.eclipse.help.internal.dynamic.IncludeHandler

          // process dynamic content
          if (processor == null) {
            processor = new DocumentProcessor(new ProcessorHandler[] {
              new ValidationHandler(getRequiredAttributes()),
              new NormalizeHandler(),
              new IncludeHandler(reader, locale),
              new ExtensionHandler(reader, locale)
            });
          }
          processor.process(root, '/' + descriptor.getBundleId() + '/' + descriptor.getFile());
         
View Full Code Here

Examples of org.eclipse.help.internal.dynamic.IncludeHandler

  private void process(List contributions) {
    if (processor == null) {
      DocumentReader reader = new DocumentReader();
      processor = new DocumentProcessor(new ProcessorHandler[] {
        new NormalizeHandler(),
        new IncludeHandler(reader, locale),
        new ExtensionHandler(reader, locale),
      });
    }
    Iterator iter = contributions.iterator();
    while (iter.hasNext()) {
View Full Code Here

Examples of org.eclipse.help.internal.dynamic.IncludeHandler

    if (processor == null) {
      DocumentReader reader = new DocumentReader();
      processor = new DocumentProcessor(new ProcessorHandler[] {
        new FilterHandler(CheatSheetEvaluationContext.getContext()),
        new NormalizeHandler(),
        new IncludeHandler(reader, Platform.getNL()),
        new ExtensionHandler(reader, Platform.getNL())
      });
    }
    String documentPath = null;
    if (input.getPluginId() != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.