User Tag List

Results 1 to 3 of 3

Thread: Syntax Highlighting

  1. #1
    Gibdo beefster09's Avatar
    Join Date
    Mar 2006
    Age
    31
    Posts
    699
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,710
    Level
    16
    vBActivity - Bars
    Lv. Percent
    97.44%

    Syntax Highlighting

    I'm really surprised that no one has suggested this before. It's annoying to not be able to know what you are doing right and wrong while zscripting.

    Examples of keywords could be:

    Loop and Condition-related keywords (including void run) could be dark blue.
    Hardcoded Variables could be dark teal.
    Hardcoded Functions could be dark orange.
    Comments could be dark red.
    Script and pointer types could be dark green.
    Pointers and symbols could be dark gray.

    These are all system colors. I just checked.

    Heck, I'd even be willing to make a comprehensive list of keywords.
    Avatar: Just who the SPAAAACE do you think I am?

  2. #2
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.53%

    Re: Syntax Highlighting

    The problem is, all but the most trivial syntax highlighting requires some kind of *context* instead of simple pattern matching. For instance, in the following script,
    Code:
    ffc script foo {
       void run()
       {
          Screen->D[0] = 1;
          {
             int Screen = 0;
             Screen = Screen*2;
          }
       }
    }
    the syntax highlighter would need to understand that the first instance of Screen should be highlighted in the "built-in" color, but that the next two lines are just normal variables.

    The compiler can figure things out of course, but at compile time, not during real-time editing.

  3. #3
    Gibdo beefster09's Avatar
    Join Date
    Mar 2006
    Age
    31
    Posts
    699
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,710
    Level
    16
    vBActivity - Bars
    Lv. Percent
    97.44%

    Re: Syntax Highlighting

    I think JCreator has source code. I think it's in Java, but you could probably take a peek at the syntax highlighting code to see a very efficient way to syntax highlight. And maybe you could borrow the code because aren't Java and C++ somewhat similar?

    I'm desperate for syntax highlighting, yet I don't know C++. XD I'm taking it this year, though.
    Avatar: Just who the SPAAAACE do you think I am?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social