{"id":31811221,"url":"https://github.com/ezequias2d/snot","last_synced_at":"2026-05-17T03:37:52.990Z","repository":{"id":107447597,"uuid":"606275201","full_name":"ezequias2d/snot","owner":"ezequias2d","description":"Stack, Simple, Stupid, Straightforward or Silly Notation","archived":false,"fork":false,"pushed_at":"2023-12-30T20:22:32.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-30T21:58:01.601Z","etag":null,"topics":["config","configuration-files","data-serialization","json","json-alternative","markup-language","parser","seralization","serialization-format","snot","toml-alternative","xml","yaml-alternative"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ezequias2d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-25T02:19:44.000Z","updated_at":"2023-11-22T01:22:37.000Z","dependencies_parsed_at":"2023-03-13T14:35:44.657Z","dependency_job_id":null,"html_url":"https://github.com/ezequias2d/snot","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/ezequias2d/snot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezequias2d%2Fsnot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezequias2d%2Fsnot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezequias2d%2Fsnot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezequias2d%2Fsnot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ezequias2d","download_url":"https://codeload.github.com/ezequias2d/snot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezequias2d%2Fsnot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006451,"owners_count":26084107,"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-10-11T02:00:06.511Z","response_time":55,"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":["config","configuration-files","data-serialization","json","json-alternative","markup-language","parser","seralization","serialization-format","snot","toml-alternative","xml","yaml-alternative"],"created_at":"2025-10-11T06:39:55.127Z","updated_at":"2025-10-11T06:40:00.786Z","avatar_url":"https://github.com/ezequias2d.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SNOT\n\nStack, Simple, Stupid, Straightforward or Silly  Notation is a stack-based human-readable data-serialization language. It is inspired by XML, but aims to be simple(maybe it didn't work).\n\n**WIP: Missing implementation of string escape sequence greater than one character**\n\n## Syntax\n\nI was just thinking about trying to use as few symbols (or anything else as keywords) to represent things, so the language has no reserved keyword.\n\nTherefore, any sequence of valid unicode characters that are not whitespaces, symbols used by language or starting with an arabic digit is an 'identifier', 'string' are enclosed in double quotes and support C-like escape sequence and has semantically the same meaning as identifiers, 'number' starts with a arabic digit and need to be in a valid format.\n\nOoh, whitespaces separate only the tokens, so indentation is not necessary if you do not want to use.\n\n### Identifier\n\n```\neach word in this phase is an identifier and this phrase must be recognized as a valid SNOT\n```\n\n### String\n```\n\"yeah, it's just ordinary string syntax\\nHello World!\" \\\n\"but I thought of this syntax to make a multiline string\"\n```\n| Escape sequence |     Description    |    Representation     |\n|:---------------:|--------------------|:---------------------:|\n|`\\a`             | audible beil       | 0x07 in ASCII         |\n|`\\b`             | backspace          | 0x08 in ASCII         |\n|`\\e`             | escape character   | 0x1B in ASCII         |\n|`\\f`             | page break         | 0x0C in ASCII         |\n|`\\n`             | newline            | 0x0A in ASCII         |\n|`\\r`             | carriage return    | 0x0D in ASCII         |\n|`\\t`             | horizontal tab     | 0x09 in ASCII         |\n|`\\v`             | vertical tab       | 0x0B in ASCII         |\n|`\\\\`             | backslash          | 0x5C in ASCII         |\n|`\\\"`             | double quote       | 0x22 in ASCII         |\n|`\\?`             | question mark      | 0x3F in ASCII         |\n|`\\nnn`           | octal byte         | any                   |\n|`\\xhh`           | hexadecimal byte   | any                   |\n|`\\uhhhh`         | unicode code point | code point U+nnnn     |\n|`\\uhhhhhhhh`     | unicode code point | code point U+nnnnnnnn |\n\n### Number\n```\ndecimal     116104971163911532973211011710998101114\noctal       0157143164141154\nhexadecimal 0x706172652064652070656E73617220717565206EE36F\nreal        10210811197116.63\n```\n### Symbols\n\nThe symbols used is:\n```\n, stack pop\n; two stack pop\n. three stack pop\n( stack mark\n) stack pop until stack mark\n\\ continue last stack token\n```\n\n### Example\n\nSo with all of this you can write something like this:\n\n```\nglossary\n  title \"example glossary\";\n  GlossDiv\n    title S;\n    GlossEntry\n      ID SGML;\n      SortAs SGML;\n      GlossTerm \"Standard Generalized Markup Language\";\n      Acronym SGML;\n      Abbrev \"ISO 8879:1986\";\n      GlossDef \n        para \"A meta-markup language, used to create markup languages such as DocBook.\";\n        GlossSeeAlso GML, XML.\n      GlossSee markup\n```\n\nStack starts emtpy, when it finds any value token(identifier, string or number) its pushed into stack, but if stack peek token are a identifier or string(number is invalid), the previous token is turned into a \"section\" token, any tokens inserted after the section token in stack are inside that section and sections maybe inside other sections.\n\nWhen finds a comma, semicolon or a period symbol the last 1, 2 or 3, respectively, tokens are popped from stack, soo you can insert more values into a section without create new sections.\n\nBut if 1, 2 or 3 pop is not enough for you, you can drop everything and use parentheses. The '(' symbol will add a token into the stack that is ignored by the rule that generates sections and ')' will pops until reaching the '(' token.\n\n```\nweb-app\n  (servlet\n    servlet-name cofaxCDS;\n    servlet-class \"org.cofax.cds.CDSServlet\";\n    init-param\n      configGlossary:installationAt \"Philadelphia, PA\";\n      configGlossary:adminEmail \"ksm@pobox.com\";\n  )\n  (serverlet\n    serverlet-name cofaxEmail;\n    servlet-class \"org.cofax.cds.EmailServlet\";\n    init-param\n      mailHost mail1;\n      mailHostOverride mail2\n  )\n  (serverlet\n    serverlet-name cofaxAdmin;\n    servlet-class \"org.cofax.cds.AdminServlet\"\n  )\n```\n\n## Usage\n\nThis library is self contained in a single header file and can be used either in header only mode or in implementation mode. The header only mode is the default when included and allows including this header in other headers and does not contain the implementation.\n\nThe implementation mode requires the macro `SNOT_IMPLEMENTATION` into .c file before `#include`:\n```C\n#define SNOT_IMPLEMENTATION\n#include \"snot.h\" /* or \"snot.h\" */\n```\n\nTo make the implementation private to the file that generates the implementation:\n```C\n#define SNOT_STATIC\n#define SNOT_IMPLEMENTATION\n#include \"snot.h\" /* or \"snot.h\" */\n```\n\nSample code\n\n```C\n#define SNOT_IMPLEMENTATION\n#include \"snot.h\"\n\n#include \u003cmalloc.h\u003e\n#include \u003cstdio.h\u003e\n\nvoid *__grow(void *memory, size_t *size, size_t grow_size);\nvoid __start_section(SNOT_PARSER *parser, size_t id, void *userdata);\nvoid __end_section(SNOT_PARSER *parser, size_t id, void *userdata);\nvoid __string(SNOT_PARSER *parser, size_t id, void *userdata);\nvoid __number(SNOT_PARSER *parser, size_t id, void *userdata);\n\nint main(void) \n{\n    SNOT_PARSER *parser;\n    SNOT_CALLBACKS cx;\n    void *userdata = NULL;\n    size_t file_size;\n    const char *filename = \"document.snot\";\n\n    cx.alloc         = malloc;\n    cx.free          = free;\n    cx.grow          = __grow;\n    cx.start_section = __start_section;\n    cx.end_section   = __end_section;\n    cx.string        = __string;\n    cx.number        = __number;\n\n    parser = snot_create(cx, userdata);\n\n    FILE *file = fopen(filename, \"r\");\n    if (!file)\n    {\n        printf(\"cannot open %s\\n\", filename);\n        return -1;\n    }\n\n    fseek(file, 0, SEEK_END);\n    file_size = ftell(file);\n    fseek(file, 0, SEEK_SET);\n\n    while (file_size--)\n    {\n        // ASCII\n        char c;\n        fread(\u0026c, sizeof(char), 1, file);\n\n        // fill the parser each with character at a time\n        SNOT_RESULT result = snot_parse(parser, c);\n        switch (result)\n        {\n        case SNOT_OK:\n            break;\n        case SNOT_ERROR_NO_MEMORY:\n        case SNOT_ERROR_INVALID_CHARACTER:\n        case SNOT_ERROR_PARTIAL:\n        case SNOT_ERROR_TOKEN_TYPE_UNDEFINED:\n            printf(\"Error at %c(code: %d)\\n\", c, result);\n            file_size = 0;\n            break;\n        }\n    }\n    fclose(file);\n\n    snot_end(parser);\n    snot_free(parser);\n\n    return 0;\n}\n```\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezequias2d%2Fsnot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fezequias2d%2Fsnot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezequias2d%2Fsnot/lists"}