{"id":22286995,"url":"https://github.com/koraa/gema","last_synced_at":"2025-08-25T19:05:27.215Z","repository":{"id":145351489,"uuid":"465696462","full_name":"koraa/gema","owner":"koraa","description":"Import of the general purpose macro processor CVS repo","archived":false,"fork":false,"pushed_at":"2022-03-20T15:17:38.000Z","size":220,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-04T11:34:38.485Z","etag":null,"topics":["awk","macro","macro-processor","programming-language","sed","text-generation","text-processing"],"latest_commit_sha":null,"homepage":"http://gema.sourceforge.net/new/index.shtml","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koraa.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-03T11:45:51.000Z","updated_at":"2024-12-30T00:55:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"144a5cb3-d3b0-4b31-9482-9123253508a4","html_url":"https://github.com/koraa/gema","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/koraa/gema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koraa%2Fgema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koraa%2Fgema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koraa%2Fgema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koraa%2Fgema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koraa","download_url":"https://codeload.github.com/koraa/gema/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koraa%2Fgema/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272116857,"owners_count":24876268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awk","macro","macro-processor","programming-language","sed","text-generation","text-processing"],"created_at":"2024-12-03T16:58:53.824Z","updated_at":"2025-08-25T19:05:27.205Z","avatar_url":"https://github.com/koraa.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Since this covering this I have run it through valgrind and the depths of hell have opened up. GEMA seems to be completely full of use after free errors. Some of these likely constitute security vulnerabilities. I will leave this repository up because I still think the language is nice but I do not reccomend using it for anything other than experimentation with data you trust as input.\n\n# General Purpose Text Processor\n\nrewrite is an import of the original gema repository. gema the source code has not been updated since 2004, but despite this, it just seems to work!\n\ngema is a general purpose text processing utility based on the concept of pattern matching. In general, it reads an input file and copies it to an output file, while performing certain transformations to the data as specified by a set of patterns defined by the user. It can be used to do the sorts of things that are done by Unix utilities such as `cpp`, `grep`, `sed`, `awk`, or strings. It can be used as a macro processor, but it is much more general than `cpp` or `m4` because it does not impose any particular syntax for what a macro call looks like. Unlike utilities like `sed` or `awk`, gema can deal with patterns that span multiple lines and with nested constructs. It is also distinguished by being able to use multiple sets of rules to be used in different contexts.\n\nHomepage: https://gema.sourceforge.net/new/index.shtml  \nHomepage (archived): https://web.archive.org/web/2021*/http://gema.sourceforge.net/new/index.shtml  \n\n### Quickstart\n\n```sh\ncd ./src\nsh gemabuild\n./gema\n```\n\n### Install\n\n```sh\ncd ./src\nsh gemabuild\nsudo sh gemabuild install\n```\n\n### Documentation\n\n```sh\ncd ./doc\nmake\n```\n\n## Original Readme\n\nThis directory contains \"gema\", the general-purpose macro processor.\nThe sub-directories are:\n\n   src        source program (in ANSI C)\n   doc        documentation, including Unix \"man\" page and user manual.\n   examples   sample applications, including LaTeX to HTML conversion.\n   test       script and data for verification of build\n\nThis description applies to version 1.4.\n\nThe program currently works on several varieties of Unix, MS-DOS,\nMicrosoft Windows, and Macintosh (both OS-X and earlier MACOS with\nMPW). It may need some modification for use on other systems, particular\nin regard to pathname syntax and accessing file attributes; see the\nplaces where ``#ifdef unix'', ``#ifdef MSDOS'', and ``#ifdef MACOS'' are\nused.\n\nOn most systems, you can build the program by just cd-ing to the \"src\"\ndirectory and then running the command \"gemabuild\".  This will build and\ntest the program, automatically selecting the appropriate compiler\noptions for any of many common operating systems.  (There are actually\ntwo script files, \"gemabuild\" for Unix and \"gemabuild.bat\" for Windows.)\n\n## Further build details if needed\n\nTo build the program, you just need to use an ANSI C compiler to\ncompile all of the \".c\" files and link the resulting object files\ntogether.  An example \"Makefile\" for Unix is provided.  Normally you\nshould compile with optimization and with the option \"-DNDEBUG\" to omit\ninternal debugging checks.  You may also want to use \"-DTRACE\" to\nenable the experimental diagnostic trace option.\n\nFor MS-DOS (16-bit mode), there is a \"gema.mak\" file from Microsoft\nQuick C.  It builds using the \"small memory model\".  You'll need to\nspecify a stack size somewhere in the range of 4000 to 6000 bytes; I'm\ncurrently using 5600.\n\nAfter building the program, you can verify that it works correctly by\nrunning the command \"gematest\" in the \"test\" directory (script file\n\"gematest\" for Unix or \"gematest.bat\" for Windows.) The test passes if\nno file comparison differences are reported.\n\nThe \"examples\" directory includes the following non-trivial pattern files\nfor document conversion:\n\n    latex.dat      convert LaTeX to HTML\n    man-html.dat   convert \"man\" page from \"nroff\" to HTML\n    ht.dat         convert HTML to LaTeX\n    tex.dat        used with \"latex.dat\" for low-level TeX features\n\nThe script \"latex.sh\" can be used for LaTeX to HTML conversion after\nmodifying it for the actual location of the files used.  It takes care of\nautomatically running the program a second time when needed to resolve\nforward references. \n\nThese conversion pattern files are not complete; they have been\nsufficient for the documents I have been working with, but you may find\nadditional features that you need.  The conversion provides a clear\nwarning about what is not recognized, and extending the patterns is easy.\n\nAlso in the \"examples\" directory is file \"c2dyl.dat\", which reads C\nsource files and does a crude preliminary syntax conversion to the new\nDylan programming language.  Even if you aren't interested in Dylan, this\nfile serves as an example of how recursive pattern matching can be used\nto parse infix expressions; note how the rules look very similar to a BNF\ndescription of the expression syntax.\n\n\n\"gema\" is not a commercial product; it has been donated to the public\ndomain in order to maximize its usefulness.  Let me know if you find any\nbugs, but I don't promise to fix them.  If you fix something or extend\nthe program yourself, please send me your improvements.  Also send me\ne-mail if you would like to be informed of any future updates.\n\n    David N. Gray\n\n    e-mail:  DGray@acm.org\n\n    175 Dalma Drive\n    Mountain View, CA  94041\n\n    February, 2002\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoraa%2Fgema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoraa%2Fgema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoraa%2Fgema/lists"}