Package org.apache.uima.ruta.ide.parser.ast

Examples of org.apache.uima.ruta.ide.parser.ast.RutaModuleDeclaration


  private IPath[] generateResources(ModuleDeclaration moduleDeclaration, IPath outputPath,
          IContainer container, ISourceModule sourceModule) throws CoreException {
    List<IPath> result = new ArrayList<IPath>();
    if (moduleDeclaration instanceof RutaModuleDeclaration) {
      RutaModuleDeclaration tmmd = (RutaModuleDeclaration) moduleDeclaration;
      DescriptorManager sm = tmmd.descriptorInfo;
      IPath pathToModule = sourceModule.getResource().getLocation();
      String elementName = RutaProjectUtils.getModuleName(pathToModule);

      IScriptProject proj = sourceModule.getScriptProject();
View Full Code Here


  }

  public IModuleDeclaration parse(String fileName, String content, IProblemReporter reporter) {
    this.problemReporter = reporter;

    RutaModuleDeclaration moduleDeclaration = new RutaModuleDeclaration(content.length(), true);

    CharStream st = new ANTLRStringStream(content);
    RutaLexer lexer = new TMLexer(st);

    CommonTokenStream tokens = new CommonTokenStream(lexer);
View Full Code Here

    String startPart = tk.getWordPrefix();
    this.setSourceRange(position - startPart.length(), position);

    // 090813:
    RutaModuleDeclaration parsed = (RutaModuleDeclaration) this.parser.parse(module);

    // types = getShortNames(types);
    if (classloader == null) {
      IScriptProject scriptProject = sourceModule.getModelElement().getScriptProject();
      try {
        Collection<String> dependencies = RutaProjectUtils.getClassPath(scriptProject.getProject());
        URL[] urls = new URL[dependencies.size()];
        int counter = 0;
        for (String dep : dependencies) {
          urls[counter] = new File(dep).toURI().toURL();
          counter++;
        }
        classloader = new URLClassLoader(urls);
      } catch (MalformedURLException e) {
        RutaIdeCorePlugin.error(e);
      } catch (CoreException e) {
        RutaIdeCorePlugin.error(e);
      }
    }

    ASTNode node;
    if (parsed != null) {
      try {
        RutaReferenceVisitor referenceVisitor = new RutaReferenceVisitor(actualCompletionPosition);
        parsed.traverse(referenceVisitor);
        node = referenceVisitor.getResult();

        if (node == null) {
          doCompletionOnEmptyStatement(module, position, i);
          doCompletionOnDeclaration(module, startPart);
View Full Code Here

        moduleDeclaration.traverse(referenceVisitor);
        ASTNode node = referenceVisitor.getResult();
        if (node instanceof RutaVariableReference
                && moduleDeclaration instanceof RutaModuleDeclaration) {
          RutaVariableReference vr = (RutaVariableReference) node;
          RutaModuleDeclaration parsed = (RutaModuleDeclaration) moduleDeclaration;
          if (vr.getType() == RutaTypeConstants.RUTA_TYPE_AT) {
            String nodeText = vr.getStringRepresentation();
            Collection<String> importedTypeSystems = parsed.descriptorInfo.getImportedTypeSystems();
            List<IHyperlink> result = new ArrayList<IHyperlink>();
            for (String tsString : importedTypeSystems) {
View Full Code Here

  public void doOtherHighlighting(ISourceModule code,
          final ISemanticHighlightingRequestor semanticHighlightingRequestor) {
    ModuleDeclaration moduleDeclaration = SourceParserUtil
            .getModuleDeclaration((org.eclipse.dltk.core.ISourceModule) (code.getModelElement()));
    if (moduleDeclaration instanceof RutaModuleDeclaration) {
      RutaModuleDeclaration md = (RutaModuleDeclaration) moduleDeclaration;
      if (md != null) {

        // do highlightings

      }
View Full Code Here

  private IPath[] generateResources(ModuleDeclaration moduleDeclaration, IPath outputPath,
          IContainer container, ISourceModule sourceModule) {
    List<IPath> result = new ArrayList<IPath>();
    if (moduleDeclaration instanceof RutaModuleDeclaration) {
      RutaModuleDeclaration tmmd = (RutaModuleDeclaration) moduleDeclaration;
      DescriptorManager sm = tmmd.descriptorInfo;
      IPath pathToModule = sourceModule.getResource().getLocation();
      String elementName = RutaProjectUtils.getModuleName(pathToModule);

      IScriptProject proj = sourceModule.getScriptProject();
View Full Code Here

        moduleDeclaration.traverse(referenceVisitor);
        ASTNode node = referenceVisitor.getResult();
        if (node instanceof RutaVariableReference
                && moduleDeclaration instanceof RutaModuleDeclaration) {
          RutaVariableReference vr = (RutaVariableReference) node;
          RutaModuleDeclaration parsed = (RutaModuleDeclaration) moduleDeclaration;
          if (vr.getType() == RutaTypeConstants.RUTA_TYPE_AT) {
            String nodeText = vr.getStringRepresentation();
            Collection<String> importedTypeSystems = parsed.descriptorInfo.getImportedTypeSystems();
            List<IHyperlink> result = new ArrayList<IHyperlink>();
            for (String tsString : importedTypeSystems) {
View Full Code Here

    String startPart = tk.getWordPrefix();
    this.setSourceRange(position - startPart.length(), position);

    // 090813:
    RutaModuleDeclaration parsed = (RutaModuleDeclaration) this.parser.parse(module);

    // types = getShortNames(types);

    ASTNode node;
    if (parsed != null) {
      try {
        RutaReferenceVisitor referenceVisitor = new RutaReferenceVisitor(
                actualCompletionPosition);
        parsed.traverse(referenceVisitor);
        node = referenceVisitor.getResult();
       
        if (node == null) {
          doCompletionOnEmptyStatement(module, position, i);
          doCompletionOnDeclaration(module, startPart);
View Full Code Here

  }

  public IModuleDeclaration parse(String fileName, String content, IProblemReporter reporter) {
    this.problemReporter = reporter;

    RutaModuleDeclaration moduleDeclaration = new RutaModuleDeclaration(content.length(),
            true);

    CharStream st = new ANTLRStringStream(content);
    RutaLexer lexer = new TMLexer(st);
View Full Code Here

  public void doOtherHighlighting(ISourceModule code,
          final ISemanticHighlightingRequestor semanticHighlightingRequestor) {
    ModuleDeclaration moduleDeclaration = SourceParserUtil
            .getModuleDeclaration((org.eclipse.dltk.core.ISourceModule) (code.getModelElement()));
    if (moduleDeclaration instanceof RutaModuleDeclaration) {
      RutaModuleDeclaration md = (RutaModuleDeclaration) moduleDeclaration;
      if (md != null) {

        // do highlightings

      }
View Full Code Here

TOP

Related Classes of org.apache.uima.ruta.ide.parser.ast.RutaModuleDeclaration

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.