Highlighting variables

Highlighting variables

2
NewbieNewbie
2

    Mar 25, 2006#1

    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"

      Mar 25, 2006#2

      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

      119
      Power UserPower User
      119

        Mar 25, 2006#3

        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.

        1
        NewbieNewbie
        1

          Apr 16, 2008#4

          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