Thread: Dev-C++ -> Tools - > Editor -> Syntax

  1. #1
    Banned Yuri2's Avatar
    Join Date
    Jul 2006
    Location
    Breukelen, Netherlands
    Posts
    2

    Dev-C++ -> Tools - > Editor -> Syntax

    Hi (again).
    In Dev-C++ -> Tools -> Editor Options -> Syntax, you can modifie the colors of indentifiers, symbols, reserved words and etc.
    My question is if you can change the strings where the editor reacts on of the reserved words.
    Normally like 'int', 'char', 'if' etc. will turn bold but I am wondering of you can change the strings where it reacts to.
    Thanks.

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Unfortunately not with Dev-C++. I've once looked through the files installed and there doesn't seem to be anything either. It seems to be hardcoded into dev-c++ executable.

    CodeBlocks offer that functionality, if you must have it.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    I don't think I understand by "change the strings where the editor reacts on". I'm going to guess you mean changing the actual keyword string. As in... you can change int to integer. The answer to that is of course, no. Keywords are standard so they don't conflict with identifiers, functions, and class names. If you made them whatever you wanted and pasted someone else's code, their identifiers might conflict with your custom keywords.
    Sent from my iPadŽ

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    I believe he means adding user defined keywords
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #5
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    What the hell is a user defined keyword? All "keyword" means is it's reserved by the language. So user defined keyword means what exactly? You want to make up words that you can't use as identifiers?
    Sent from my iPadŽ

  6. #6
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    If you want to color code your user-defined objects and namespaces for instance.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  7. #7
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    You can... they're called identifers. It's in the list of syntax. Select it and change the color to whatever you want.
    Sent from my iPadŽ

  8. #8
    Banned Yuri2's Avatar
    Join Date
    Jul 2006
    Location
    Breukelen, Netherlands
    Posts
    2
    Well for example: If I want to use 'Integer' instead standard 'int', I could do it like this, I do think though that it shouldn't be used:

    PHP Code:
    # define Integer int 

  9. #9
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    That's not the editor, that's in the code. There is nothing wrong with that if you like it, really... but changing the way the editor displays reserved words is a different story.
    Sent from my iPadŽ

  10. #10
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Yuri
    # define Integer int
    Yes. That's ugly. Even though windows libraries are renowned for using such defines.

    CodeBlocks allows you to change those colors since you can edit the list of reserved words
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  11. #11
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by SlyMaelstrom
    That's not the editor, that's in the code. There is nothing wrong with that if you like it, really... but changing the way the editor displays reserved words is a different story.
    Lol! Why exactly?

    It's a matter of taste, don't you agree? No rules are being broken. Some people do find it easy to change the list of reserved words so that they can specify their own. It doesn't alter the rules of the language, just the way the editor display these words.

    Why do you think so many editors offer this functionality?
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  12. #12
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Yes it does alter the rules of the language. If I wanted to change the reserved int data type to the foo data type... almost any code example in the history of coding would end up conflicting.
    Code:
    #include <iostream>
    
    foo main() {
       foo foo = 10;
       std::cout << "This is the number 10: " << foo;
    }
    Now depending on how your silly implementation works, you'll either end up changing all the instances of foo back to int or it will just leave it all as foo. Either way, the compiler is going to complain that your using a reserved word as an identifier.

    We're not talking about color or font here Mario, we're talking about THE ACTUAL WORD. Changing this is not offered in any legitimate C++ compiler.
    Sent from my iPadŽ

  13. #13
    Banned Yuri3's Avatar
    Join Date
    Jul 2006
    Location
    Breukelen, Netherlands
    Posts
    2
    Well:
    PHP Code:
    # define Integer int 
    Is something like this, right?
    PHP Code:
    typedef int Intgerer 
    Ok, now asume you attempt the first code, the define code, with all C++ standard keywords.
    For example:
    PHP Code:
    # define Boolean bool
    # define Character char
    # define Integer int
    ...
    # define If if 
    At my Dev-C++ compiler it bolds the keywords , but if I define it like above I can use my
    own keywords but my own keywords are not bolded out by the compiler,
    logical, because they are not standard.

  14. #14
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Hi (again).
    In Dev-C++ -> Tools -> Editor Options -> Syntax, you can modifie the colors of indentifiers, symbols, reserved words and etc.
    My question is if you can change the strings where the editor reacts on of the reserved words.
    Normally like 'int', 'char', 'if' etc. will turn bold but I am wondering of you can change the strings where it reacts to.
    Sly, this is the OP question.

    Now... what part of it don't you understand?
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  15. #15
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    You have to bolden all of your identifiers. That can yield ugly code, though. Check codeblocks and see if they offer more options as to what exactly your enboldening, but I'm not sure they'll give you too many more options. To most compilers an identifer is an identifer, regardless of whether it's a type definition or a variable name or whatever.
    Sent from my iPadŽ

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 07:33 AM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM