[antlr-interest] Grammars for API description
Ben Senior
ben at autonomic.net
Wed Apr 27 02:27:33 PDT 2011
Hi, sorry if this is too vague for the list... but I had an odd dream
last night about using grammars to enforce API structure...
I remember there was an effort years ago when component based
development hype was at its peak that one way to define components was
in the way they interact with one another (which fell down because in
describing that in detail, you're essentially implementing the
internals)... but nevertheless... clients don't really "command/ask"
servers simple questions... api calls follow patterns, individual calls
make up sentences.
Just taking it from a security angle, given a particular authenticated
role, wouldn't a grammar based description of how which api's can be
called be a major improvement over the current situation (and quite a
useful abstraction)? The key of course is in the stateful/contextual
nature of the state machine which would parse the api requests as tokens
and validate whether the interaction patterns are valid.
Has anybody heard of anybody doing something like this? Was it a success?
Thanks,
Ben
More information about the antlr-interest
mailing list