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

Restructured the repository. #2830

Closed
wants to merge 1 commit into from
Closed

Conversation

KOLANICH
Copy link
Contributor

Fixes: #2826

@kaby76
Copy link
Contributor

kaby76 commented Sep 17, 2022

As I expected, the first thing I had to do was create a Bash function to cd around because I'm totally lost otherwise.

Kenne@DESKTOP-DL44R7B MINGW64 ~/proposal/grammars-v4
$ mycd() { pushd .; d=`find . -name "$1" -type d`; cd "$d"; }

Kenne@DESKTOP-DL44R7B MINGW64 ~/proposal/grammars-v4
$ mycd abb
~/proposal/grammars-v4 ~/proposal/grammars-v4

Kenne@DESKTOP-DL44R7B MINGW64 ~/proposal/grammars-v4/embedded/abb
$ ls
abbLexer.g4  abbParser.g4  examples/  pom.xml  readme.txt

Kenne@DESKTOP-DL44R7B MINGW64 ~/proposal/grammars-v4/embedded/abb
$ popd
~/proposal/grammars-v4

Kenne@DESKTOP-DL44R7B MINGW64 ~/proposal/grammars-v4
$ mycd cpp
~/proposal/grammars-v4 ~/proposal/grammars-v4

Kenne@DESKTOP-DL44R7B MINGW64 ~/proposal/grammars-v4/programming/mainstream/cpp
$ ls
CPP14Lexer.g4  CPP14Parser.g4  examples/  pom.xml

Kenne@DESKTOP-DL44R7B MINGW64 ~/proposal/grammars-v4/programming/mainstream/cpp
$ popd
~/proposal/grammars-v4

Kenne@DESKTOP-DL44R7B MINGW64 ~/proposal/grammars-v4
$

It works okay for most things, but not everything. For example, there are many directories named "java" (some of which are incorrectly named in lowercase before this PR). An alternative is to grep through all pom.xml for grammar names.

$ cat find-grammar.sh
#!/usr/bin/bash
where=`dirname -- "$0"`
cd "$where"
poms=`find . -name pom.xml | grep -v Generated | grep -v target | grep -v .ignore`
grep -i -E "<grammarName>.*"$1".*</grammarName>" $poms

So, as expected, we going to need a script to navigate around this new structure, which takes the grammar name, or something else. For sure, people are also going to need an index.html or readme.md to find the grammars for "C++", "java", or what have you. If this is added, then the reorg could work out fine.

The build doesn't work because Maven uses the pom.xml to recursively descend the directory structure, which has now changed. Honestly, I think it's rather brain-dead that the pom's have to describe a separate tree structure on top of a file system--Maven should just search down a file system recursively looking for pom.xml.

Note: a more computer science-oriented classification is here. Note that many languages have multiple classifications.

@teverett
Copy link
Member

@KOLANICH do we still need this PR?

@KOLANICH
Copy link
Contributor Author

I have created it to make the navigation and selection (the purpose of a grammar says something about its complexity, for example identifiers are likely to be simpler than a mainstream programming language) easier. IDK if the projects maintainers do still need the changes proposed here

@teverett
Copy link
Member

teverett commented Jan 2, 2023

@KOLANICH thanks for this. I'll close it for now.

@teverett teverett closed this Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reorganize this repo: distribute the dirs over categories
3 participants