Package at.ssw.coco.lib.model.atgAst

Examples of at.ssw.coco.lib.model.atgAst.AtgAst


      throws CoreException, OperationCanceledException {
    RefactoringStatus result = super.checkInitialConditions(pm);
    pm.worked(50);
   
    //Check if Selection is a Token
    AtgAst atgAst = info.getAtgEditor().getAtgAstManager().getAtgAst();
    List<AbstractAtgAstNode> nodes =
      atgAst.getNodes(info.getOffset(), info.getOldName().length());
    boolean pragmaIdentFound = false;
    for (AbstractAtgAstNode node : nodes) {
      if (node instanceof IdentNode &&
        ((IdentNode) node).getKind() == IdentNode.Kind.PRAGMA)
      {
View Full Code Here


      throws CoreException, OperationCanceledException {
    RefactoringStatus result = super.checkInitialConditions(pm);
    pm.worked(50);
   
    //Check if Selection is a Production
    AtgAst atgAst = info.getAtgEditor().getAtgAstManager().getAtgAst();
    List<AbstractAtgAstNode> nodes =
      atgAst.getNodes(info.getOffset(), info.getOldName().length());
    boolean characterSetIdentFound = false;
    for (AbstractAtgAstNode node : nodes) {
      if (node instanceof IdentNode &&
        (((IdentNode) node).getKind() == IdentNode.Kind.PRODUCTION ||
         ((IdentNode) node).getKind() == IdentNode.Kind.COMPILER))
View Full Code Here

      throws CoreException, OperationCanceledException {
    RefactoringStatus result = super.checkInitialConditions(pm);
    pm.worked(50);
   
    //Check if Selection is a Token
    AtgAst atgAst = info.getAtgEditor().getAtgAstManager().getAtgAst();
    List<AbstractAtgAstNode> nodes =
      atgAst.getNodes(info.getOffset(), info.getOldName().length());
    boolean characterSetIdentFound = false;
    for (AbstractAtgAstNode node : nodes) {
      if (node instanceof IdentNode &&
        ((IdentNode) node).getKind() == IdentNode.Kind.TOKEN)
      {
View Full Code Here

      IDocumentProvider documentProvider = atgEditor.getDocumentProvider();
      IDocument document = documentProvider.getDocument(editorInput);
      document.addDocumentListener(documentListener);
      String text = document.get(0, document.getLength());
      InputStream in = new ByteArrayInputStream(text.getBytes("UTF-8"));
      atgAst = new AtgAst(in);
      dirty = false;
    } catch (BadLocationException e) {
      e.printStackTrace();
    } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
View Full Code Here

      throws CoreException, OperationCanceledException {
    RefactoringStatus result = super.checkInitialConditions(pm);
    pm.worked(50);
   
    //Check if Selection is a CharacterSet
    AtgAst atgAst = info.getAtgEditor().getAtgAstManager().getAtgAst();
    List<AbstractAtgAstNode> nodes =
      atgAst.getNodes(info.getOffset(), info.getOldName().length());
    boolean characterSetIdentFound = false;
    for (AbstractAtgAstNode node : nodes) {
      if (node instanceof IdentNode &&
        ((IdentNode) node).getKind() == IdentNode.Kind.CHARACTER_SET)
      {
View Full Code Here

   *
   * @param selection
   * @return true if text selection is renameable
   */
  private boolean isRenameable(final ITextSelection selection) {
    AtgAst atgAst = getAtgAst();   
    if (atgAst != null) {
      List<AbstractAtgAstNode> selectedNodes =
        atgAst.getNodes(selection.getOffset(), selection.getLength());

      for (AbstractAtgAstNode n : selectedNodes) {
        if (n instanceof IdentNode &&
          (((IdentNode)n).getKind() == IdentNode.Kind.CHARACTER_SET ||
           ((IdentNode)n).getKind() == IdentNode.Kind.TOKEN ||
View Full Code Here

  private final static String PATH = "src/at/ssw/coco/lib/atgAst/internal/junit/junitTest.atg";

  @BeforeClass
  public static void beforeClass() throws FileNotFoundException {
    File testFile = new File(PATH);
    atgAst = new AtgAst(new FileInputStream(testFile))
    root = atgAst.getRoot();
  }
View Full Code Here

TOP

Related Classes of at.ssw.coco.lib.model.atgAst.AtgAst

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.