Giter VIP home page Giter VIP logo

Comments (15)

ericvanwyk avatar ericvanwyk commented on August 17, 2024

from copper.

tedinski avatar tedinski commented on August 17, 2024

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.

schwerdf avatar schwerdf commented on August 17, 2024

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.

ericvanwyk avatar ericvanwyk commented on August 17, 2024

from copper.

remexre avatar remexre commented on August 17, 2024

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.

ericvanwyk avatar ericvanwyk commented on August 17, 2024

from copper.

remexre avatar remexre commented on August 17, 2024

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.

tedinski avatar tedinski commented on August 17, 2024

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.

ericvanwyk avatar ericvanwyk commented on August 17, 2024

from copper.

tedinski avatar tedinski commented on August 17, 2024

It's basically type classes, isn't it?

from copper.

ericvanwyk avatar ericvanwyk commented on August 17, 2024

from copper.

remexre avatar remexre commented on August 17, 2024

I'm going to try making an extension for silver that does Terminal -> TerminalDescriptor; sound good to everyone?

from copper.

ericvanwyk avatar ericvanwyk commented on August 17, 2024

from copper.

remexre avatar remexre commented on August 17, 2024

Does this look good for a TerminalDescriptor type?

from copper.

remexre avatar remexre commented on August 17, 2024

Talked with Eric, moving this to a Silver issue, will summarize there.

from copper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.