Open Jerome2606 opened 5 years ago
Hi Support is on the google discussion group
Envoyé de mon iPhone
Le 14 déc. 2018 à 19:06, Jérôme Lambert notifications@github.com a écrit :
Hello,
I was looking how I can use my existing grammar to support async/await.
I was reading this post: https://stackoverflow.com/questions/51640627/how-an-antlr-visitor-or-listener-can-be-written-with-async-await-on-its-methods?rq=1
But actually the way, I'm using Antlr is by calling this method:
public virtual Result Visit(IParseTree tree) { return tree.Accept
((IParseTreeVisitor ) this); } I don't understand how I can override this method to make my code fully async/await. Source of my question is issue with long process in visitor and api unstability.
Thanks
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Oh ok I will switch to the discussion group.
Seems there is no support from google groups discussion.
Any idea from here ? Async support ?
The so article you are referring to seems pretty straightforward. Not sure what you expect from the runtime that can't be achieved in your own code.
For C# there is not article from my search. I'm looking for a way to generate the C# class code from .g4 with async/await ready.
Someking of "now supporting async/await in C# generated code"
In my own code, I'm using the Visit / Parse and VisitChildren but nothing is async/await.
I don’t support the idea of generating this, because it would convert each node visit into an asynchronous call... It seems trivial to override the generated visitor and implement Async await where you need it.
Envoyé de mon iPhone
Le 28 janv. 2019 à 18:53, Jérôme Lambert notifications@github.com a écrit :
For C# there is not article from my search. I'm looking for a way to generate the C# class code from .g4 with async/await ready.
Someking of "now supporting async/await in C# generated code"
In my own code, I'm using the Visit / Parse and VisitChildren but nothing is async/await.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
@Jerome2606 The listeners do not support async/await because the methods return void
. However, the visitors do support async/await:
Task<TResult>
or ValueTask<TResult>
as the return valueDefaultResult
to return Task.FromResult(default(TResult))
(preferably cached in a static readonly field)@sharwell mmh seems very interesting, I will give a try (lot of code to changes but I will do it).
Thanks
Hello,
I was looking how I can use my existing grammar to support async/await.
I was reading this post: https://stackoverflow.com/questions/51640627/how-an-antlr-visitor-or-listener-can-be-written-with-async-await-on-its-methods?rq=1
But actually the way, I'm using Antlr is by calling this method:
I don't understand how I can override this method to make my code fully async/await.
Source of my question is issue with long process in visitor and api unstability.
Thanks