Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Analyze COBOL source with Regex

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 19-02-2010
Member
 
Join Date: Dec 2009
Posts: 178
Analyze COBOL source with Regex
  

Hello,
I try to analyze a COBOL source file, I would recognize the term "PROCEDURE DIVISION. For this I use the following pattern:
Pattern pattern = Pattern.compiles( "$^.*?(? i)\\bprocedure\\b.\\p (Space). (? i)\\bdivision\\b. * ", Pattern.Dotall | Pattern.MULTILINE );
This expression is preceded by white and only white. I tried without the line end and beginning of the line, nothing to do, it does not. Someone can help me? Thank you.

Reply With Quote
  #2  
Old 19-02-2010
Member
 
Join Date: Nov 2009
Posts: 583
Re: Analyze COBOL source with Regex

Hello,
Proposal not guarantee the hypothesis that one or more lines are passed to the matcher
Code:
Pattern pattern = Pattern.compiles( "^\\p (Space) * procedure\\(p) + Space division .* $ ", Pattern.MULTILINE | Pattern.Case_insensitive );
- ^ \ \ p (Space) * to recognize "white" before the line
- procedure
- \ \ p (Space) + for at least one "white"
- Division
- $ .* To accept anything until the end of line

I did not put that because I do not. between procedure and division and put case_insensitive to avoid (? i).
Reply With Quote
  #3  
Old 19-02-2010
Member
 
Join Date: Dec 2009
Posts: 292
Re: Analyze COBOL source with Regex

Hello,
I was trying for a similar problem a few days before and here is the topic now, I am the interested if you have a solution for this, by the way your assumption is correct. In fact, I have forgotten the white top of the line (like what to write the problem and reread it makes a difference). Unfortunately it does not work. What is the maximum size of a String object?
Reply With Quote
  #4  
Old 19-02-2010
Member
 
Join Date: Dec 2009
Posts: 178
Re: Analyze COBOL source with Regex

Hello,
After rereading my algo, I found it was not good, Our solutions are both correct . I did not put dotall because I do not. between procedure and division and put case_insensitive to avoid (? i). I at least learned how to do it. Thank you again for your availability. And if you have any other alternative solution for this then please let me know.
Reply With Quote
  #5  
Old 19-02-2010
Member
 
Join Date: Dec 2009
Posts: 292
Re: Analyze COBOL source with Regex

Hello,
Thanks for your reply guys. I understand why a file of several thousand lines did not in a String. What idea indeed. It works best with an array of String. Ok, so, even i will also use the array of string now to do the things, and if you have any information about this, then please do post back. I have tried a code for this and I have got an error, but I think I can solve the error, if no then I will post here.
Reply With Quote
  #6  
Old 19-02-2010
Member
 
Join Date: Nov 2009
Posts: 518
Re: Analyze COBOL source with Regex

Hello,
The problem is the same for all containers that have an index (table, CharSequence, Collection, some flows, ...) and / or table internally. But in good general index 2 ^ 31-1 (2 billion +) is already not so bad. I hope you are getting the thing what we are trying to explain to you, I recommend you to have a tutorial or a documentation on the regular expression on the how to use it with cobol programming language and then write the codes for it.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Analyze COBOL source with Regex"
Thread Thread Starter Forum Replies Last Post
How to analyze BSOD Kernel Dump Dwarner Operating Systems 5 23-03-2010 08:57 AM
How to Analyze Downloads from Internet CAILYN Networking & Security 5 06-03-2010 11:05 AM
3d analyze emulator for Windows Deepest BLUE Windows Software 5 22-01-2010 05:21 AM
Debugging mode in Cobol Fragman Software Development 5 02-01-2010 01:27 PM
Analyze your disk depth with Xinorbis SoftwareGuy Tips & Tweaks 1 20-02-2009 10:40 AM


All times are GMT +5.5. The time now is 11:40 PM.