Comments (15)
from copper.
From what I remember, there's nothing on Copper's side here to do, unless you wanted something from the partially constructed tree stack. The way e.g. the eclipse-silver code works, it mutates a list of tokens during parsing, so you could just access them from the parser object after catching the parse error exception.
from copper.
Copper has no explicit support for partial parsing of erroneous input (although it is, of course, possible to accumulate a token list through the semantic actions).
from copper.
from copper.
The changes to Terminal
present in the feature/ide
and feature/monto+highlight
branches of Silver already create make Terminal
a superclass of all terminals, I think.
from copper.
from copper.
Maybe not a solution that'll be complete in a short time, but one solution would be to add what Rust calls trait objects to Silver. E.g. If I could write
synthesized attribute foo :: String;
traitishThing FooHaver(foo); -- I have the best words
function getFoo
String ::= fooTraitObject::FooHaver
{
return "foo = " ++ fooTraitObject.foo;
}
and then any type with the foo
attribute could be upcasted to the FooHaver
type. I think these could be implemented as Java interfaces with minimal overhead.
We could then make TerminalDescriptor
something like (startLoc, endLoc, lexeme, lexerClasses, grammarName, terminalName)
.
from copper.
This is properly a Silver issue at this point, I think.
We don't necessarily need anything fancy. I had hoped to have no general Terminal
type in Silver at all, because I hoped it'd just be Java code that cared.
from copper.
from copper.
It's basically type classes, isn't it?
from copper.
from copper.
I'm going to try making an extension for silver that does Terminal -> TerminalDescriptor; sound good to everyone?
from copper.
from copper.
Does this look good for a TerminalDescriptor
type?
from copper.
Talked with Eric, moving this to a Silver issue, will summarize there.
from copper.
Related Issues (20)
- Get Copper's XML I/O in order. HOT 3
- Make dumps programmatically accessible.
- Verify all production signatures are unique.
- Require all operator precedence classes to be explicitly declared.
- "Remove nonterminals from the 'validLA' sets in the parse table."
- SlidingWindowScannerBuffer building a new string for every character read?
- Allow number of items per line to vary when pretty printing.
- Separate disambiguation functions from disambiguation groups in XML dump. HOT 1
- Unresolvable lexical ambiguities between ignore terminals not caught during compilation HOT 1
- Disambiguation classes HOT 16
- MDA for disambiguation classes fails due to reference of extension terminals from host grammar HOT 17
- Allow shiftable set to be accessed from disambiguation functions applicable to subsets HOT 9
- Copper hangs when compiling a simple grammar HOT 8
- Disambiguation functions are free to return a terminal not part of the set they are disambiguating HOT 2
- Layout on extension productions can cause unexpected parse errors in host code HOT 1
- Error for empty ranges in regular expressions
- Semantic actions on layout terminals are delayed HOT 10
- Grammar railroad diagram HOT 8
- Adding copper to maven central HOT 2
- Significant memory usage regression with #59 on large grammars HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from copper.