Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext Lexer and Parser(Xtext Lexer and Parser)
Xtext Lexer and Parser [message #1786605] Tue, 08 May 2018 05:54
Eclipse UserFriend
Hello,

I am working to build an editor for one of the legacy language.
I got stuck at place where I need some help.
I am trying to explain my problem with java example.

Class Test {                                                           
           public static void main(String[] args ){ 
                 System.out.println("Virag");                            
                 method();                                                        
           }                                                           
           public static method(){             
                System.out.println("Purnam");                                    
           }                                                                
}


Now in the above example, I want to parse the main class and if any methods are called then that method content should be part of my main class code.
Expected content in document.
Class Test {                                                           
           public static void main(String[] args ){ 
                 System.out.println("Virag");                            
                 System.out.println("Purnam");                                                        
           }                                                         

}


I can achieve this in lexer, but after that I face problem is editor.
After parsing I get the proper content, but in next iteration it is creating problem.
As character positions got changed, on edit it enters/delete characters from wrong text region.
How to fix this in editor, so that edit works fine.
How can I fix this? Any help will be much appreciated.

Thanks and regards,
Virag Purnam
Previous Topic:DSL template functions (specialization)
Next Topic:How to let Tycho resolve dependencies in xtext-maven-plugin?
Goto Forum:
  


Current Time: Fri Jun 13 19:47:15 EDT 2025

Powered by FUDForum. Page generated in 0.02170 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top