|
From: Esteban B. <ebo...@da...> - 2004-11-09 17:33:13
|
Hello, I agree with Robert. The specification of a language generally can't be changed so easily, sometimes because it is simply not in one's hands, or because that would entail breaking thousands of lines of code. I have tried with this rule, <MARK_FOLLOWING TYPE="NULL">.</MARK_FOLLOWING> But it breaks number literals such as 3.21. To solve this last problem, a "brute-force" approach would be to define the following 10 rules, one for each digit in the 0-9 range: <MARK_FOLLOWING TYPE="DIGIT">0.</MARK_FOLLOWING> <MARK_FOLLOWING TYPE="DIGIT">1.</MARK_FOLLOWING> <MARK_FOLLOWING TYPE="DIGIT">2.</MARK_FOLLOWING> <MARK_FOLLOWING TYPE="DIGIT">3.</MARK_FOLLOWING> <MARK_FOLLOWING TYPE="DIGIT">4.</MARK_FOLLOWING> <MARK_FOLLOWING TYPE="DIGIT">5.</MARK_FOLLOWING> <MARK_FOLLOWING TYPE="DIGIT">6.</MARK_FOLLOWING> <MARK_FOLLOWING TYPE="DIGIT">7.</MARK_FOLLOWING> <MARK_FOLLOWING TYPE="DIGIT">8.</MARK_FOLLOWING> <MARK_FOLLOWING TYPE="DIGIT">9.</MARK_FOLLOWING> But that, in turn, affects elements like "object61.member", which should be painted entirely as a default (NULL) token. Perhaps there's a clean and elegant way (a "jEdit way") to make the distinction. Any ideas? Thank you, Esteban. > -----Original Message----- > From: jed...@li... > [mailto:jed...@li...]On Behalf Of Robert > William Vesterman > Sent: Martes, 09 de Noviembre de 2004 11:59 > To: jEdit-Users > Subject: RE: [ jEdit-users ] Edit modes: how to express a distinction > between a keyword and a field reference. > > > There are certainly languages in which some keywords have only partial > restrictions on how they can be used. If you don't want to call them > "keywords", that's fine with me, but their existence needs addressing > anyway. For example, in the TAL language, you can name a > variable FILLER or > BIT_FILLER, as long as that variable is not contained inside of a > structure > (wherein those words have special meaning). > > Moreover, in many cases, one simply cannot just "fix the syntax of the > language", as one has no control over the language's definition. God help > you trying to get TAL changed. > > Finally, there are numerous situations in which people may find it more > useful to play loose and fast with what are considered keywords. For > example, in C, "size_t" is not a keyword, strictly speaking, but > I care more > to have it syntax highlighted the same way as "int" and "char" > than I do to > worry about speaking strictly. I don't really care that, > pedantically, it's > not a keyword. But at the same time, there is nothing unequivocally > stopping you from writing a C program that contains a variable or function > named "size_t", or a C++ program with one named "string" (or even > "std::string"), or any number of similar things in any number of other > languages. > > -----Original Message----- > From: jed...@li... > [mailto:jed...@li...]On Behalf Of Trevor > Harmon > Sent: Tuesday, November 09, 2004 11:30 AM > To: Esteban Bolanos > Cc: jEdit-Users > Subject: Re: [ jEdit-users ] Edit modes: how to express a distinction > between a keyword and a field reference. > > > On Nov 9, 2004, at 7:43 AM, Esteban Bolanos wrote: > > > We have defined a keyword for the data type "hour": > > <KEYWORD4>hour</KEYWORD4> > > In our language, "hour" can also be the name of a field within an > > object or > > structure, so that a reference to such member, say, "order.hour" or > > "connection.hour", is valid. > > Doesn't that break the definition of keyword? I mean, if you can use it > as a member name, then it's not a keyword, is it? One of the reasons > you have keywords (AFAIK) is so that you don't run into accidental > complexities like the one you're experiencing with jEdit. Perhaps the > best solution is to fix the syntax of your language so that keywords > truly are keywords. > > Trevor > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > -- > ----------------------------------------------- > jEdit Users' List > jEd...@li... > https://lists.sourceforge.net/lists/listinfo/jedit-users > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > -- > ----------------------------------------------- > jEdit Users' List > jEd...@li... > https://lists.sourceforge.net/lists/listinfo/jedit-users > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.788 / Virus Database: 533 - Release Date: 01/11/2004 > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.788 / Virus Database: 533 - Release Date: 01/11/2004 |