Posted 17 years ago by Matt Whitfield
Version: 4.0.0239
Avatar
Ok, i'm writing a SQL language editor, and I have one problem. The tables in the northwind database that comes with SQL Server are particularly stupid, and have spaces in the names.

So I need to modify my syntax language (which is very much the same as the SQL language that comes with syntax editor) so that

'Order Details' is two tokens, but '[Order Details]' is returned as only 3 (i.e. '[', 'Order Details', ']')

So basically what I'm asking is...

How do i make syntax editor ignore space as a token delimiter if the token is surrounded by '[' and ']'

Also where is the list of updates so that I can see what has been updated in .239 to .241?

Comments (6)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Do you mean when "Order Details" is in plain text without quotes? If I understand you correctly, I don't think you should code for that since if you combine identifier tokens, it will probably cause other issues for your parsing later on. But if you do want to, just update IdentifierToken's regex to include spaces.

Any updates to our products are always listed in the Readme's release history as well as in our announcements forum.


Actipro Software Support

Posted 17 years ago by Matt Whitfield
Avatar
No i mean when 'Order Details' is enclosed by square brackets '[' and ']' - this is SQL's way of quoting identifier names

I was messing about and i created another state, similar to string state which starts with a '[' and ends with a ']'.

But i must confess that I don't really know what i'm doing with the Regular Expression stuff.

So am I on the right track?
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sorry I'm still a little confused on the question. Right now '[', 'Order Details' and ']' are the 3 tokens that get parsed. Are you saying you want a regex that does a single token?


Actipro Software Support

Posted 17 years ago by Matt Whitfield
Avatar
No, currently you get 5 tokens:

'[', 'Order', <WhiteSpace>, 'Details', ']'

And i'm trying to get 3:

'[', 'Order Details', ']'

I think it's because the XML i'm using didn't have what you call 'Square String State'. I guess that's where the confusion is coming from? Sorry!
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Matt,

It might be easier if you just send over your language definition via email since the one that we include with the sample project parses to 3 tokens.


Actipro Software Support

Posted 17 years ago by Matt Whitfield
Avatar
Yes I know - i said in the message above that my language definition was missing the 'square string state' - that's the state that's included in your sample project's SQL definition.

So i'm all good, at least i know that i'm doing the right thing for sure now, thanks for the help!
The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.