Skip to content
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

Replace incomplete csdgmAliases with module parsed from complete text file #3

Open
JeffJacobson opened this issue Jan 21, 2016 · 0 comments

Comments

@JeffJacobson
Copy link
Contributor

Parse the reference/csdgm.txt file into JSON to get complete list of elements. This can be used to replace the csdgmAliases.js file.

  1. Read text line by line.

  2. Use the regular expression see if the current line is the first line of an element definition.

    // Matches first line of element definition
    var firstLine = /^\s*([\d\.]+)\s+(.+)\s-+\s(.+)/;
    /* [
        entire match, 
        element index number, 
        element long name, 
        description (until line break)
       ]
    */
  3. Lines after the first line of an element definition are a continuation of the description from the first line.

  4. The description stops when a line starting with (not including spaces) Type: is encountered.

  5. The Short Name: line indicates what the XML nodes name will be.

  6. Keep reading lines until another "first line" is encountered, which indicates a new element definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant