re for dm

General questions about using TextPad

Moderators: AmigoJack, helios, bbadmin, Bob Hansen, MudGuard

Post Reply
User avatar
Nicholas Jordan
Posts: 124
Joined: Mon Dec 20, 2004 12:33 am
Location: Central Texas ISO Latin-1
Contact:

re for dm

Post by Nicholas Jordan »

Code: Select all

zarfDLL.c(103) : Error: invalid simple type name destructor
not proficient at re's - this is a typical for my compiler, need to focus on what I am working on .... will try a regex to capture line number to show some work:

Code: Select all

^[:alnum:]+\.[:alnum:][(]\([:digit:]+\)
That's the best I can do, it does not look like re's given for capturing compiler line number for single click to line from "Tool Output" window.
ben_josephs
Posts: 2456
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

I'm afraid I don't entirely understand your message. Please use simple language and leave out the obscurities.

But are you looking for something like
Regular expression to match output: ^([[:alnum:]]+\.[[:alnum:]])\(([[:digit:]]+)\)

Registers:
File: 1
Line: 2
or
Regular expression to match output: ^([a-z0-9]+\.[ch])\(([0-9]+)\)

Registers:
File: 1
Line: 2
?
Evil Bob
Posts: 3
Joined: Sat Feb 14, 2009 3:10 am

Re: re for dm

Post by Evil Bob »

Code: Select all

zarfDLL.c(103) : Error: invalid simple type name destructor
It looks like you are trying to capture the code inside the parenthesis. You could use:

Find:::^[^\(]+\(([^)]+)\).+$
Replace:::Error: \1

This would replace the entire line with "Error: 103" using the example, and ignore all parenthesis after the first set.
User avatar
Nicholas Jordan
Posts: 124
Joined: Mon Dec 20, 2004 12:33 am
Location: Central Texas ISO Latin-1
Contact:

Post by Nicholas Jordan »

ben_josephs wrote:I'm afraid I don't entirely understand your message. Please use simple language and leave out the obscurities.
sorry, seemed pretty simple to me - re for jump to line on compiler diagnostic - first code block is a line I took as "typical"

What are the

Registers:
File: 1
Line: 2

? ... I have no idea what this is for nor where applies.

My apologies, no intent to be obscure.
User avatar
Nicholas Jordan
Posts: 124
Joined: Mon Dec 20, 2004 12:33 am
Location: Central Texas ISO Latin-1
Contact:

Re: re for dm

Post by Nicholas Jordan »

Evil Bob wrote:It looks like you are trying to capture the code inside the parenthesis.
Yes, but I have no idea how these compiler jumps work so I was guessing....

Not a good idea to do that.
ben_josephs
Posts: 2456
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

In Configure | Preferences | Tools | <Your tool>
set something similar to
Regular expression to match output: ^([a-z0-9]+\.[ch])\(([0-9]+)\)

Registers:
File: 1
Line: 2
The regex contains two sets of capturing parentheses. They are numbered from the left, starting at 1, by the positions of the opening parentheses. The "register" numbered n holds the text that was matched by the nth parenthesised regular subexpression.

Code: Select all

 1                  2
 |                  |
 V                  V
^([a-z0-9]+\.[ch])\(([0-9]+)\)
In Posix syntax, capturing parentheses are unescaped and literal parentheses are escaped. (In the default syntax it's the other way around.)
User avatar
Nicholas Jordan
Posts: 124
Joined: Mon Dec 20, 2004 12:33 am
Location: Central Texas ISO Latin-1
Contact:

much clearer

Post by Nicholas Jordan »

Okay, I think I grasp what is going on. Attempted a rewrite which I will try both this and what you posted. The first capture is any allowable filename under win, but the compiler only recognize dot c and dot cpp ( or h && hxx ) so the approach I took was first group is anything not opening paren in compiler std out, then try to get past that paren and capture line number in second grouping.

Code: Select all

^\([^(]+\)\(?(\)\([0-9]+\)
       ^    ^   ^ ^
       |    | |   | second grouping, for line number
       |    | | close "there but do not capture"
       |    | there but do not capture 
       | one or more not paren 
I will try this and what you posted.

My apologies again, let me know if this is clearer post. I had just lost the machine totally and was coming back up, trying to continue working during system recovery.
ben_josephs
Posts: 2456
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Here's a corrected version of your regex:
^([^(]+)\(([0-9]+)\)

It assumes Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
User avatar
Nicholas Jordan
Posts: 124
Joined: Mon Dec 20, 2004 12:33 am
Location: Central Texas ISO Latin-1
Contact:

partial result

Post by Nicholas Jordan »

Okay, I have tried:

Code: Select all


 * ^[^0-9]+(\([0-9]+\)
 * ^([a-z0-9]+\.[c])\(([0-9]+)\) 
 * ^([a-z0-9]+\.[ch])(\([0-9]+\)) 
 * Here's a corrected version of your regex:
 * ^([^(]+)\(([0-9]+)\)
Those are directly from using the comments field in the source file as a fast short buffer. I have tried all of the above and am getting some jumps, about 20% or so it goes to the line number - I am considering trying to turn off trasparent dialog boxes in xp as clearly that calls into 16-bit non-renetrant code as does the tool output window, I am getting some builds and better jumps would be adjunct to coding effectiveness.
ben_josephs
Posts: 2456
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

What are the messages from your compiler that you are having trouble with?

I'm afraid I'm unclear what transparent dialogue boxes and 16-bit non-re-entrant code have to do with this problem, and I don't know what an adjunct to coding effectiveness is.
User avatar
Nicholas Jordan
Posts: 124
Joined: Mon Dec 20, 2004 12:33 am
Location: Central Texas ISO Latin-1
Contact:

posted

Post by Nicholas Jordan »

Code: Select all

zarfDLL.c(103) : Error: invalid simple type name destructor
is exactly the syntax I am trying to captue. Filename(line number) - enable hyper-jumps, in this example on line 103 of file zarfDLL.c an error is being reported "invalid simple type name destructor"

As for the other two matters, the name of this tool I am building "zarf" is a coffee holder for coffee that is too hot to handle so though it seems simple to me please disreguard the other two comments by me.
ben_josephs
Posts: 2456
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

That is the same style as before, and that is what my suggestions were designed for. They both work.
User avatar
Nicholas Jordan
Posts: 124
Joined: Mon Dec 20, 2004 12:33 am
Location: Central Texas ISO Latin-1
Contact:

thanks

Post by Nicholas Jordan »

Okay, I'm underway. Must be the double-click response - maybe there's a shortcut key .... Okay, it's f-4, issue retired.
Post Reply