Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
ANTLR is a great piece of software, but, in my opinion, is a little bit uncomfortable for a C# programmer (the C# porting is out of date, the parser antlr-3.1.3.jar required java, etc)
I'm looking for a "more C# native" language tool in order to parse a simple json-like grammar, any suggestion?
I've used the GOLD Parser Generator, a freeware tool that you can use to specify BNF grammars, and then generate a parser in almost any target language including C#. You can also modify the way the parser generator generates C# code by altering a text template.
http://www.devincook.com/goldparser/
peg-sharp (C# packrat parser) is a simple but valid alternative.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
Where is the grammar of the current version of the C# language?
I mean a grammar similar to this SQL grammar: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html
I would like to check, for example, what is the complex_pattern element mentioned on the https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-7.0/pattern-matching page and how it relates to the pattern and primary_pattern grammar elements defined on the https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-9.0/patterns3 page. Where can I find it in the grammar?
The most recent version of C# with a (draft) specification is C# 6.0. There's a grammar interspersed in the specification.
More recent versions of C# don't have a specification yet (you have to take the C# 6.0 specification, and add in proposals from features present in later versions, e.g. here).
The Roslyn repository contains a generated grammar from the most recent version of the compiler, currently here. Search the Roslyn repository for filename:g4 if it moves.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I want to know Is there any compiler-compiler library that is written in C# or Not ?
I know Antlr & JavaCC but these library wrote in Java
Is there any library like antlr but in C# (or ported in C#) and open source or not ?
Can anybody introduce them ?
There is Irony. I've never used it myself though.
The C# compiler is itself written in C#, and with Roslyn, this has been made open source.
https://github.com/dotnet/roslyn
There is also a C# port of JavaCC, however, it's no longer maintained. The author switched to Irony instead. If you're just looking for code for examples, it would do that.
https://github.com/deveel/csharpcc
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I would like to explore the use of formal language processing in the context of natural languages. To do so, I am searching for a parser generator that is robust to ambiguity in the sense that it won't denote EBNF as invalid when it multiple productions can be used to produce the same string. Furthermore, the standard way of handling redundancy is by returning parse forests instead of parse trees.
I am NOT asking what the best tool is, but only if there are tools that can be obtained for C#. And if there are, where can I find them.
It does not matter if the tool is open-source or proprietary.
The answer will be awarded to the longest list of unique (not mentioned earlier) tools which satisfy the required constraints on the parser returned by the parser generator.
Please help me explore parse forests.
You may find an implementation of Earley's Algorithm that does what you want, e.g. https://github.com/coonsta/earley
My own natural language engine (nlp.abodit.com) is based on an algorithm similar to Earley's.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I know C# is different from .NET Framework, C# is a programming language that standard by ECMA (ECMA-334) and ISO (ISO/IEC 23270).
I don't want a converter that converts ANY C# source code (including .NET Framework) to C, but I want a tool that converts an ECMA standard C# source code to ANSI C source code.
Something like java2c but for ECMA C#.
There is not exactly such thing, but the Vala programming language is able to take a source code very similar to C#, and generate C codem or compile it directly.
http://live.gnome.org/Vala
Of course, the only problem are the libraries: C# has a lot of API's that you'll have to provide, or modify your source code to adapt to the Vala standard library.
If you wanted to translate this code to C because you need it compiled, there are other possibilities.
For example, ngen in the microsoft world:
http://msdn.microsoft.com/en-us/library/6t9t5wcf(v=vs.80).aspx
In the mono project, you can create a single exe file with the interpreter and the libraries. Look for mkbundle:
http://www.mono-project.com/Mono:Runtime
Mono is able to compile "ahead of time", i.e., generate the native code even before the program is going to be executed, so it will run faster.
http://www.mono-project.com/Mono:Runtime#Ahead-of-time_compilation
Depends on what you mean. If you mean "Is it possible to convert C# to readable and maintainable C-code?", then sorry, the answer is no — C# features don't directly map to C.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I builded a mechanizm which is responsible for creating scripts based on C# language.
To do that I used TextEdit where I paste C# code and CodeDom mechanizm to generate dynamic type on server side.
Everything is working great.
I want to replace this TextEdit. I need component who will give me an oportunity to write C# code with right formatting (as in Visual Studio Text Editor) and would be great if this component will be validate it's content (C# syntax).
Has anyone can help me ?
Have a look at: Scintilla.NET
check this:
http://www.codeproject.com/KB/edit/SyntaxHighlighting.aspx