smucclaw / baby-l4

A miniature version of the l4 language
BSD 3-Clause "New" or "Revised" License
10 stars 6 forks source link

More template types for the CNL descriptions #105

Open inariksit opened 3 years ago

inariksit commented 3 years ago

Currently, after #88 , the parser supports descriptions like

class Game {
    win : Player -> Bool
}

lexicon win -> "{Player} wins {Game}"

Now, we want to support

Until now, we have assumed that the classes are always NPs, and predicates are NPs, APs or VPs. Now even classes can be APs. This is a real example, I couldn't have made it up myself. :-D

The overall problem is where these things happen. Right now we have a RGL-based parsing grammar, where we parse the description. The pieces of the parsed description become then the concrete syntax of our application grammar, which has extremely simple abstract syntax. The abstract syntax is optimised for being easy to manipulate from an external program, and there is nothing linguistically motivated there.

Simplified workflow for one layer of grammars would be this:

simplified example of the pipeline

We need to add extra steps to accommodate for 2 layers of grammars. I don't know what is the best way to proceed.