Where can i find g4 file for G4 structure ANTLR4? - antlr4

I would like to validate G4 structure file with ANTLR 4... is it possible ?

You are looking for ANTLRv4Parser.g4 and ANTLRv4Lexer.g4. You will find them in the source code download for the "The Definitive ANTLR 4 Reference" book on the Pragmatic Bookshelf website (pragprog.com). Check in the code/reference directory.

Related

Raylib Easing Functions Header Implementation

I'm a newbie coder and decided on using raylib to learn c / c#.. I saw an example with reasings.h header file and wanted to run that example on my local machine. I installed raylib via https://github.com/raylib-extras/game-premake
Everything worked perfectly and the raylib game runs, however I'm not sure how to use readings.h in the include sections because it says file not found, was curious how I could use this header?
Also I do see the reasings.h in my C drive C:\Users\Hoyos\Desktop\m_c_t\RAYLIB_proj1\raylib-master\examples\shapes.
Any help would be appreciated. ty!
Short answer: Just put the reasings.h in the same folder as your shapes_easings_ball_anim.c file (I suspect you are using this example).
Here you can find a longer answer: Reading the header of a file

ANTLR4 target file names

For the TypeScript ANTLR target that Sam and I have been working on, I would like to have the code generation tool create a single typescript file to hold all the classes generated from a named grammar input. Is this output file structure going to be hard?
So for example, I'd like Expr.g4 -> Expr.g4.ts. That one file TypeScript file could contain named exports for {ExprLexer, ExprParser, and ExprListener} classes, visitor code if requested, maybe even some loose factory functions etc.
I've been looking into the source code under tool/src/org/antlr/v4/codegen to find out how the number and names of the output files are determined, in particular finding CodeGenPipeline.java, This class works in conjunction with the language-specific target class, but the pipeline has a lot (perhaps too much) knowledge of possible output files built into it. None of what I see in CodeGenPipeline.java seems well matched to my 1:1 input-to-output file model.
It seems like the knowledge of what files should be generated for a given language target should come from the language.stg file if possible, but I can't find any evidence that approach has been implemented. Can anyone fill me in on any reasons that approach can't hasn't been tried or worked?

How to import any UML/XMI files to StarUML?

I am trying to import a UML Diagram (of a C++ project) I designed in a program called Visual Paradigm.
This program allows me to save the UML diagram in various formats
)
and when I choose the XMI format (supported by StarUML through an extension
) it allows me to pick the XMI version to save the file
The problem comes when I try to import the file in StarUml: when I try to load an XMI file (I tried every version) that cames from V.P. it says "Failed to load the file";
On the other hand, if I save the diagram into UML2 format and then I try to open it, StarUML just does nothing.
Do You have any suggestions to work this problem out?
Here is a zip archive with another simpler project containing source code and XMI files (different versions) generated by Visual Paradigm: Project.rar
In StarUML Github Issues there is something very similar to you issue.
I had the same problem and the workaround proposed worked for me, search for
file "xmi-reader.js", then change in function "loadFromFile" the line:
var XMINode = dom.getElementsByTagName('XMI')[0]
to
var XMINode = dom.getElementsByTagName('xmi:XMI')[0]
Adding the name space "xmi:" to the name of the element makes it work.
Depending on you version of StarUML the file name could be xmi21-reader.js .

CMU Sphinx for Indian English

I have tried CMU Sphinx and it works fine with American English. Now,I want to use CMU Sphinx for detecting (Indian Accent) English. What exactly are the steps/changes I should do?
What you will have to do is adapt the acoustic model. Check the CMU Sphinx wiki page, they have explained the procedure of both training and adapting acoustic models. The link that works for now: http://cmusphinx.sourceforge.net/wiki/
According to what the site says,
CMUSphinx provides ways for adaptation which is sufficient for most cases when more accuracy is required. Adaptation is known to work well when you are using different recording environments (close-distance or far microphone or telephone channel), or when a slightly different accent is present (UK English or even Indian English) or even another language.
One thing you can also do is download pre-trained files from here:
https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/
The files inside these .tar.gz are a bit different from the structure I have in my version of the lib, so I had to follow the steps in the following link to make it work:
https://github.com/Uberi/speech_recognition/issues/192
I'll show the steps I have taken, which are basically what the link above says, but it may die, so here it goes:
On my computer (Ubuntu 18.04.4), the dictionaries are kept here:
~/.local/lib/python2.7/site-packages/speech_recognition/pocketsphinx-data
Inside the above folter, I had a subfolder en-US, in which I have the following files (F) and directories (D):
D acoustic-model
F language-model.lm.bin
F LICENSE.txt
F pronounciation-dictionary.dict
So I downloaded the .tar.gz for Indian language and made it look like the en-US directory. Like this:
tar zxvf cmusphinx-en-in-8khz-5.2.tar.gz
mv cmusphinx-en-in-8khz-5.2 en-IN
cd en-IN
mv en-us.lm.bin language-model.lm.bin
mv en_in.dic pronounciation-dictionary.dict
mv en_in.cd_cont_5000 acoustic-model
cd ..
Then I moved it to the correct directory.
mv en-IN ~/.local/lib/python2.7/site-packages/speech_recognition/pocketsphinx-data
From this point, I was able to use en-IN.

What is the __NULL_IMPORT_DESCRIPTOR good for (MSVC map file)?

I have a map file generated with microsoft visual studio. It contains a relatively big area named __NULL_IMPORT_DESCRIPTOR. What is this good for? It has something to do with linked dlls but I cannot figure out the exact purpose of it.
__NULL_IMPORT_DESCRIPTOR is the IMAGE_IMPORT_DESCRIPTOR structure. With all its fields set to null it indicates the end of the IMAGE_IMPORT_DESCRIPTOR array in the imports section. It takes only 20 bytes.

Resources