{"id":16798472,"url":"https://github.com/flosch/blogmath","last_synced_at":"2025-03-17T04:29:17.249Z","repository":{"id":7106089,"uuid":"8398790","full_name":"flosch/Blogmath","owner":"flosch","description":"A simple sample compiler","archived":false,"fork":false,"pushed_at":"2013-09-14T23:21:13.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-23T14:16:03.970Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.florian-schlachter.de/?tag=compiler","language":"Python","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/flosch.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}},"created_at":"2013-02-24T23:38:23.000Z","updated_at":"2020-04-09T11:44:18.000Z","dependencies_parsed_at":"2022-09-05T17:20:27.391Z","dependency_job_id":null,"html_url":"https://github.com/flosch/Blogmath","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosch%2FBlogmath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosch%2FBlogmath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosch%2FBlogmath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flosch%2FBlogmath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flosch","download_url":"https://codeload.github.com/flosch/Blogmath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243973218,"owners_count":20377155,"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","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":[],"created_at":"2024-10-13T09:25:45.924Z","updated_at":"2025-03-17T04:29:17.228Z","avatar_url":"https://github.com/flosch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Blogmath\n========\n\nA simple sample compiler/interpreter - see my compiler course at http://www.florian-schlachter.de/post/compilerbau-1/\n\nUsage\n=====\n\n\t$ cat test1.bm\n\tvar c = 2; // Exponent\n  \n\tvar s = 0.5;\n\t\n\t// Funktion zur Potenzierung\n\tlambda pow(a) = a^c;\n\t// Funktion zum Wurzelziehen\n\tlambda sqrt(a) = a^s;\n\t\n\t// Ergebnis berechnen von 5^2\n\tvar result = pow(5);\n\t// Ergebnis berechnen von 25^0.5\n\tvar result2 = sqrt(result);\n\t\n\t// Ergebnis ausgeben\n\tprint(result); // Gibt 25 aus\n\tprint(result2); // Gibt 5 aus\n\t\n\t\n\t$ python blogmath.py test1.bm\n\tBlogmath-Interpreter\n\tExecuting test1.bm...\n\t25.0\n\t5.0\n\t\n\t\n\t$ python blogmath.py\n\tBlogmath-Interpreter\n\t('quit' or CTRL-C to terminate)\n\t\u003e lambda pow(x, y) = x^y;\n\t\u003e lambda sqrt(x) = x^0.5;\n\t\u003e var hundert = pow(10, 2);\n\t\u003e print(hundert);\n\t100.0\n\t\u003e print(sqrt(hundert));\n\t10.0\n\t\u003e lambda pow10(x) = pow(x, 10);\n\t\u003e pow10(2);\n\t1024.0\n\t\u003e print(2+12/2);\n\t8.0\n\t\u003e print(5+4/3); // ohne Klammerung\n\t6.33333333333\n\t\u003e print((5+4)/3); // mit Klammerung\n\t3.0\n\t\u003e quit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflosch%2Fblogmath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflosch%2Fblogmath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflosch%2Fblogmath/lists"}