I am creating a plugin for Eclipse.
Once I downloaded the right package, it was easier than I thought.
I want to ask the group whether you think I should write my first full-
blown PEG parser, or just a simple scanner?
I want the plugin to go beyond syntax highlighting and onto
refactoring etc.
Also, I have a bug fix.
Before the fix:
evens evens == (returns true, as if it checked all even numbers)
odds ones == (returns true)
evens ones == (gives a stack exception after a while)
After:
evens evens == (waits forever while it checks them)
odds ones == (returns false)
evens ones == (returns false)
The fix is for Cat 0.17.0, I dedicate it to the public domain and its
here:
http://nothingontelly.com/goodgrief/CatFunctionalList.cs
The function PairwiseForEach has a missing ! and when this is fixed,
it runs out of stack space when comparing possibly-infinite equal
lists.
When tail recursion optimisation is added, it would give up on unequal
sized possibly-infinite lists.
This leads to some changes which perhaps don't have the beauty of the
original code.
While making this change I discovered that you can create a function
in C# without giving it a name, and have it access a local variable
(like Java's inner classes but more elegant). This is done in an
instance of the PairAccessor delegate.
Regards,
Adrian Savage
Welcome Adrian!
> I am creating a plugin for Eclipse.
Yay!
> Once I downloaded the right package, it was easier than I thought.
> I want to ask the group whether you think I should write my first full-
> blown PEG parser, or just a simple scanner?
I'd suggest starting with a simple scanner. It'll probably take much
less time, and allow you to get on to more interesting tasks. However,
I believe there is already an open-source PEG library in Java
> I want the plugin to go beyond syntax highlighting and onto
> refactoring etc.
>
> Also, I have a bug fix.
>
> Before the fix:
> evens evens == (returns true, as if it checked all even numbers)
> odds ones == (returns true)
> evens ones == (gives a stack exception after a while)
> After:
> evens evens == (waits forever while it checks them)
> odds ones == (returns false)
> evens ones == (returns false)
>
> The fix is for Cat 0.17.0, I dedicate it to the public domain and its
> here:
> http://nothingontelly.com/goodgrief/CatFunctionalList.cs
Thank you.
> The function PairwiseForEach has a missing ! and when this is fixed,
> it runs out of stack space when comparing possibly-infinite equal
> lists.
> When tail recursion optimisation is added, it would give up on unequal
> sized possibly-infinite lists.
> This leads to some changes which perhaps don't have the beauty of the
> original code.
>
> While making this change I discovered that you can create a function
> in C# without giving it a name, and have it access a local variable
> (like Java's inner classes but more elegant). This is done in an
> instance of the PairAccessor delegate.
>
> Regards,
>
> Adrian Savage
Thank you very much for your contributions and bug reports.
- Christopher
http://nothingontelly.com/CatPlugin/com.nothingontelly.plugins.Cat_1.0.0.jar
Comments are welcome; they will help me to improve it.
Regards,
Adrian Savage
- Christopher
I just tried using the Cat plugin, and when I constructed a ".cat"
file from scratch, I could see the neat Cat icon on the project
explorer pane (nice touch!). However, no syntax coloring was present
(and it red squiggle highlighted various words?). The next problem
occured when I tried to open a file:
Error opening the editor.
Bad version number in .class file
Any ideas what I could do to resolve the problem? I have no idea where
to start, and I don't know which ".class" file is being referred to.
- Christopher
- Christopher
Got the following error: "Unable to create this part due to an
internal error. Reason for the failure: The editor class could not be
instantiated. This usually indicates that the editor's class name was
mistyped in plugin.xml."
My runtime is Java 2 Runtime Environment, SE v 1.4.2_03.
I doubt reinstalling 3.3 will work (I've already downloaded and
installed three different versions of eclipse)
Cheers,
Christopher
I got it working! I am now able to create a new Cat file and type some
things, and see some syntax aware coloring and formatting.
Some comments:
- When I tride to open a couple of existing Cat file (e.g.
everything.cat or standard.cat) I get a single message "ERROR" in the
editor view.
- comments are only formatted when outside of definitions
- numbers and string are not distingusished from identifiers (this
would be nice to have).
- Ideally I'd like meta-comment labels to be italicizied, or somehow
distinguished from the meta-comment blocks.
This is exciting stuff, I can't wait for more advanced features! Let
us know when you are ready to hear ideas for fun to have features. I
am sure you have a bunch of ideas already.
Cheers,
Christopher
On 9/3/07, Adrian Savage <nothing...@googlemail.com> wrote:
I could not reproduce the first problem because the editor+plugin seem
to open existing .cat files alright on my computer.
Other problems are due to the highlighting not being very clever - it
does not handle one 'partition' (syntax element) nested in another.
It's a restriction of the default Eclipse partitioner.
A fix for that may have to wait for a version with a more complete
parser.
Regards,
Adrian
I am unfortunately completely swamped for at least the next couple of
weeks, but afterwards I will try to sit down with the plug-in, and
find out exactly what the problem is. I will conduct a detailed code
review as well.
- Christopher
- Christopher