-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Defining parser for ENDF file format #2622
Comments
The format definition: https://www.nndc.bnl.gov/csewg/docs/endf-manual.pdf |
Yes that is the format definition. The parser does not have to generate tags for all of it right now. We can add to it as needed. First is just needed to know where |
Do you know any popular programming language like C? |
You may know TeX. I will use it. |
I'm mostly familiar with C++, Python, and LaTeX. I can do C, but I don't like to. |
input.tex:
For the above input, ctags can generate following tags file:
For input.endf:
what kind of tags output do you want?
|
This includes a typo.
|
As far as reading "Table 1: Key parameters defining the hierarchy of entries in an ENDFfile", mmmm, ff and tt may not be good as the name of kinds. mat (material) may be better than mmm. |
I wonder how "1 " and " 0" should be tagged. Can we tag them as "1" and "0"? |
I found more typos. 17434 should be 7434. 07434 should be 7434. |
Based on the guessing I wrote a parser. input: n-000_n_001.endf.txt
|
Yes, you are right, So when Also, sometimes there are additional numbers beyond |
So, I'm too much of a novice to fully comprehend what those tags mean. There should be three "metadata" for every line, |
About the output, see tags(5) man page (https://docs.ctags.io/en/latest/man/tags.5.html).
I also don't know that. I can help you write a parser. However, I cannot help you know what you want Here is the parser I wrote. There are some ways to write a parser in ctags. This one is categorized to "line oriented parser written in C". masatake@e8e0015?branch=e8e0015393ae7a3b447ee886bd0884f45d11ced2&diff=unified You can edit the parser as you want. |
That looks great! If I understand C well enough, you are looking at the end of the file and updating the value of I'll clone it to my space, make the change, and see if I can't get it to work. |
Oh, sorry.
o.k. Feel free to reopen this if you need. |
I have a file format that doesn't have a parser (yet). I'd like to (if I can), write a parser so that I can use existing text-editor tools to naturally move through the file. I'd be willing to do the work, but I'm not sure where to start. There are no keywords for this as it is not a computer language. I've written a simple syntax and folding definition for the Vim editor. Not sure if that helps or not.
The different sections of the file are determined based on the content of the last ten columns of each line. (I didn't create the format. Sorry.) here is a sample:
I've labeled the columns
MMMM
,FF
, andTT
. When these change is when I need a "tag" (using the term loosely) to tell me that it has changed. Note, this is (kind of) nested in that, there are manyTT
s in eachFF
, and manyFF
s inside eachMMMM
.I've attached an example file that contains a full example.
n-000_n_001.endf.txt
The text was updated successfully, but these errors were encountered: