»
« home   paste   Anonymous | Login | Signup for a new account 09-17-2019 12:14 CEST
 
* X »
«
GeSHi - Generic Syntax Highlighter Syntax Coloriser for PHP
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000039 [GeSHi] lang minor always 12-12-05 13:52 02-11-06 19:15
Reporter nigel View Status public  
Assigned To tim-w
Priority normal Resolution open  
Status assigned   Product Version 1.1.1alpha3
Summary 0000039: Java support
Description This is a parent bug for any Java bugs that may crop up. Please leave open!
Additional Information
Attached Files

- Relationships
parent of 0000040closed tim-w Split Java keywords into smaller groups 
related to 0000068closed nigel Support two-stage parsing 

- Notes
(0000137)
BenBE
12-13-05 00:44

k, to start off:

As Java has a quite big class library it would be advisable to have subcontexts for those classes be separated by version (of the SDK introducing the class) and maybe even by a kind of hierarchical order like the import paths for those classes simular to the system done in Delphi. Thus later optimizations for highlighting only specific sources could be done more easily.

Another point I'd like to see in the Java language file was the integrated inlining support for ASM. Would be nice to have that feature in :P

This are at least hint, what features would be nice to have, maybe you can even do some more ;-)
 
(0000138)
nigel
12-13-05 09:43

I don't think subcontexts will be possible for the keywords, because how would you start a new subcontext?

The "dialect" feature will allow for us to remove some keywords from earlier versions (this is where the language is specified as "java/java1.2" for example).

I have tried highlighting a file or two, and while it is a bit slower than PHP it is still reasonable. This is because of the first-char lookup that is done on keywords that speeds things up quite a lot.

I wasn't aware that java supported inline ASM. How is it defined?
 
(0000139)
BenBE
12-13-05 11:01

I don't have an exact example for now, but our professor somehow mentioned it is possible. I'll have to look for an example on how to do it.

But as it seems it's more like calls to the wild, native environment. The only I found that could be called "Java Assembler" was the input to "Jasmin". I'll have to ask my prof more more information. I'll tell whenn I can say more.

@Subcontexts: Notice the "implicit subcontexts" I introduced in the Delphi language file. You have delphi/delphi/stdprocs/maths and delphi/delphi/stdprocs/sysutils both being subpaths, but not actual subcontexts. I'd suggest something like that for Java too to have the blocks split up a bit.

Maybe you could tell me a bit more on the "dialect" feature once it works. Would be nice for Delphi too as Object Pascal has lots of changes during its long history ;-)

@Slower: Java is a good example for why binary searching of keywords would be good ;-) IIRC it includes about 5000 different classes --> log2(5000) <13 accesses. With the current method you can go get a coup of Java :P
 
(0000140)
nigel
12-13-05 13:38

Well you can define "native" methods that are actually calls out to some other routine written in another language, but I've never encountered ASM embedded in a Java file per se.

"Java Assembler" may be java bytecode, which is output of the compiler and is run by the JVM. In which case we don't care about it ;)

I see what you mean by subcontexts. It's not a bad idea. Perhaps Tim could split out the keywords from different packages (like java.awt, javax.swing etc) and put them in their own keyword blocks. This might assist in keyword to URL conversion. I'll file a bug about it.

The "Dialect" feature: is already working and ready. This was one of this first things I did.

If you look at the PHP LANGUAGE directory, you will see php.php, php4.php and php5.php. Look inside php4.php and you see that it states its root context as 'php/php4', which is the php/php4.php file in the contexts directory. You can highlight with php4 by specifying php/php4 as the language.

So support for this already exists. The "php/php" language is like a merge of php4 and php5.

Of course with a binary tree your chance of 13 accesses is 50%, and chance of 10 or over is more like 90%. You might get lucky with the linear search, especially if it was a re-organising list (a much easier thing to implement - if a keyword is used, move it to the front of the array, because it is more likely to appear again *in theory*). I will have to look at all the options after I've had another review of the CodeParser class to see where it is slow.
 
(0000310)
nigel
02-11-06 19:15

Java support at this time is pretty good - support for variables, user-defined and inbuilt classes, interfaces, generics and annotations among other things.
 

- Issue History
Date Modified Username Field Change
12-12-05 13:52 nigel New Issue
12-12-05 13:52 nigel Status new => assigned
12-12-05 13:52 nigel Assigned To  => tim-w
12-13-05 00:44 BenBE Note Added: 0000137
12-13-05 09:43 nigel Note Added: 0000138
12-13-05 11:01 BenBE Note Added: 0000139
12-13-05 13:38 nigel Note Added: 0000140
12-13-05 23:12 BenBE Relationship added parent of 0000040
02-10-06 09:45 nigel Relationship added related to 0000068
02-11-06 19:15 nigel Note Added: 0000310

  


Mantis 1.0.0rc2[^]
Copyright © 2000 - 2005 Mantis Group
46 total queries executed.
35 unique queries executed.
Powered by Mantis Bugtracker