Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext Lexer and Parser(Xtext Lexer and Parser)
Xtext Lexer and Parser [message #1786605] Tue, 08 May 2018 09:54
Virag Purnam is currently offline Virag PurnamFriend
Messages: 142
Registered: June 2014
Senior Member
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 Apr 26 21:14:46 GMT 2024

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

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

Back to the top