Welcome to csly Discussions! #276
Replies: 3 comments 7 replies
-
Hey! Is it possible to switch the Lexer during the parsing process. E.g. switch to a different set of tokens once a specific Parser element is reached? (e.g. Language 2 inside Language 1) I also noted that using e.g. Line = "var value =1; note ---- this is not workint" But maybe I interpret it wrong. |
Beta Was this translation helpful? Give feedback.
-
Olivier,
Funny – as this email arrived I was just responding to your previous mail.
Changing the token set is a solution to the problem. I am currently experimenting with the solution.
I do have one suggestion – rather dramatic, but I think this would make the parser hugely more usable:
# Typing
The Parser should be require a single type to be provided by any production.
```csharp
var builder = new ParserBuilder<IpTablesToken, Models.IModel>();
// ............................................^^^^^^^^^^^^^ Remove or equate to return type of 'root'
var buildResult = builder.BuildParser(parserInstance, ParserType.EBNF_LL_RECURSIVE_DESCENT, "configuration");
// ..........................................................................................^^^^^^^^^ Use type of this production
```
With this each production can have any return type as long as case like `[ a | b ... ]` the return type of the `a,b,...` production have a commond type (or common derived type).
Let me know what you think?
Matthias
From: Olivier Duhart ***@***.***>
Sent: Freitag, 25. November 2022 08:18
To: b3b00/csly ***@***.***>
Cc: matthiasbannach ***@***.***>; Mention ***@***.***>
Subject: Re: [b3b00/csly] Welcome to csly Discussions! (Discussion #276)
@matthiasbannach <https://github.com/matthiasbannach> , are you ok with my answers ? do you need more explanations ? have you found another way ?
please answer.
Olivier
—
Reply to this email directly, <#276 (reply in thread)> view it on GitHub, or <https://github.com/notifications/unsubscribe-auth/ASNFY3ONM2WPR22WDUOKP5LWKBRZNANCNFSM5QUV6GFA> unsubscribe.
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/ASNFY3ITVWMDOAJIIYM6RPDWKBRZNA5CNFSM5QUV6GFKYY3PNVWWK3TUL52HS4DFWFCGS43DOVZXG2LPNZBW63LNMVXHJKTDN5WW2ZLOORPWSZGOABAJ35Y.gif> Message ID: < ***@***.***> ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thanks Olivier - Will do.On Nov 26, 2022, at 17:12, Olivier Duhart ***@***.***> wrote:
Thanks for your reply @matthiasbannach , i do not understand you proposal. Could you elaborate or give an example of parser that you imagine ?
I don't see what's the purpose of your idea.
anyway thanks for contributing
Olivier
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with this community.
Beta Was this translation helpful? Give feedback.
All reactions