Highlighting variables

Syntax highlighting, code folding, brace matching, code indenting, and function list

Highlighting variables

Postby pchiwall » Sat Mar 25, 2006 12:25 am

Hello there everyone!!

I started learning PROLOG some weeks ago and so I decided to create its syntax highlighting for UltraEdit. I've almost finished it, I based my syntax highlighting "decisions" in those of Visual Prolog 5.2. The only thing I just can't resolve is how to highlight the variables.

In Visual Prolog 5.2 variables are "coloured" green, and a variable is any word starting with an upper case letter. For example:

Variable <- this is a variable
variable <- this would be a predicate

How can I define it? I guess the syntactic definition would be something like ([A-Z]+)([A-Za-z0-9]*)... but that has nothing to do with the syntax highlight definition... so I dunno how to do it!

Can anyone help me? Thanks a bunch!!! :D

PS: I can post it here once it's finished if anyone's interested! :wink:

Silvia "Pchi"
User avatar
pchiwall
Newbie
 
Posts: 2
Joined: Fri Mar 24, 2006 12:00 am

Re: Highlighting variables

Postby pchiwall » Sat Mar 25, 2006 12:35 am

Hey there everyone!

Before you think I'm really dumb, I've just come up with a way of doing this but it's very silly, I think there should be a better way but maybe it's the only way of doing it. I simply defined:

/C4"Variables" STYLE_VARIABLE
** A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

So I finished my PROLOG syntax highlighting! :D
User avatar
pchiwall
Newbie
 
Posts: 2
Joined: Fri Mar 24, 2006 12:00 am

Re: Highlighting variables

Postby mjcarman » Sat Mar 25, 2006 3:11 pm

I don't know PROLOG, but based on your statement that "a variable is any word starting with an upper case letter" you have defined the syntax highlighting in exactly the way you should.
User avatar
mjcarman
Power User
Power User
 
Posts: 124
Joined: Thu Feb 10, 2005 12:00 am

Re: Highlighting variables

Postby arunm » Wed Apr 16, 2008 2:13 pm

Hi,

I am interested in the PROLOG syntax highlighting definitions - please post when done :)

I just downloaded the language template but, if you've already done it then I'd appreciate getting yours.

Thank!

-A
arunm
Newbie
 
Posts: 1
Joined: Wed Apr 16, 2008 2:10 pm


Return to Syntax Highlighting