{"id":13779004,"url":"https://github.com/jwillia3/BASIC","last_synced_at":"2025-05-11T12:32:34.742Z","repository":{"id":1402632,"uuid":"1439117","full_name":"jwillia3/BASIC","owner":"jwillia3","description":"An extensible BASIC interpreter in one header","archived":false,"fork":false,"pushed_at":"2018-02-15T05:00:46.000Z","size":125,"stargazers_count":117,"open_issues_count":4,"forks_count":19,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-03T18:13:36.287Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"fredwu/api_taster","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwillia3.png","metadata":{"files":{"readme":"README","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}},"created_at":"2011-03-04T11:41:54.000Z","updated_at":"2024-04-29T01:35:20.000Z","dependencies_parsed_at":"2022-07-07T11:31:41.063Z","dependency_job_id":null,"html_url":"https://github.com/jwillia3/BASIC","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/jwillia3%2FBASIC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillia3%2FBASIC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillia3%2FBASIC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillia3%2FBASIC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwillia3","download_url":"https://codeload.github.com/jwillia3/BASIC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225049018,"owners_count":17412911,"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-08-03T18:00:59.936Z","updated_at":"2024-11-17T14:31:08.764Z","avatar_url":"https://github.com/jwillia3.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"\t\t\tBASIC INTERPRETER\n\t\t\tJERRY WILLIAMS JR\n\nThank you for you interest in my little BASIC interpreter.\nSince a few people have asked, I've started including the license here in the repository.\nI have enjoyed hearing from people who find a use for this, so please do send me an e-mail if you feel so inclined.\nThe license is the same as MIT with the paragraph removed:\n\tThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n\nSTATEMENTS:\n\t#\tCOMMENT ...\n\t\u003e\tEXPR\n\tDIM\tVAR(LENGTH)\n\tLOCAL\t[VAR [, VAR ...]]\n\tSUB\tNAME [PARAM [, PARAM ...]] ... END SUB\n\tNAME\t[ARG [, ARG ...]]\n\tRETURN\t[EXPRESSION]\t\n\tIF\tCONDITION ... [ELSE IF CONDITION ...] [ELSE ...] END IF\n\tIF\tCONDITION THEN STATEMENT\n\tWHILE\tCONDITION ... END WHILE\n\tFOR\tVAR=INIT TO FINAL ... END FOR\n\tFORMAT\tSTRING [, EXPRESSION ...]\n\tRESUME\n\tBREAK\n\tBYE\n\t\n\t* \"%\" IN \"FORMAT\" PRINTS THE NEXT ARGUMENT AS AN INTEGER\n\t* \"SUB\" MAY NOT BE NESTED\n\t* \"LOCAL\" MAY ONLY BE USED IN A SUBROUTINE\n\nEXPRESSIONS:\n\tNUMBER, \"\", NAME, NAME(INDEX), NAME(ARG,...), UBOUND(VAR), (EXPRESSION)\n\t[EXPRESSION {*|/|\\}] EXPRESSION\n\t[EXPRESSION {+|-}] EXPRESSION\n\t[EXPRESSION {=|\u003c|\u003e|\u003c\u003e|\u003c=|=\u003e}] EXPRESSION\n\t[EXPRESSION {AND|OR}] EXPRESSION\n\t\n\t* BOOLEAN VALUES ARE -1 FOR TRUE AND 0 FOR FALSE\n\t* \"AND\" AND \"OR\" ARE NOT SHORT-CIRCUITING\n\t* OPERATORS ARE LEFT-ASSOCIATIVE\n\t* STRINGS SHOULD ONLY BE USED FOR \"FORMAT\"\n\nGENERAL NOTES:\n\t* VARIABLES ARE CASE-INSENSITIVE\n\t* ARRAY INDEXES START FROM 1\n\t\n\n\n\t\t\tIMPLEMENTATION\n\n\t* ALL BLOCK STRUCTURES LEAVE THEIR KEYWORD AT THE TOP\n\t\tOF THE C-STACK TO BE CHECKED AGAINST \"END\"\n\t* \"TEMP\" KEEPS TRACK OF HOW MANY CELLS ARE ON THE\n\t\tRUN-TIME STACK. \"RETURN\" DROPS THESE BEFORE\n\t\tEXITING THE FUNCTION.\n\t* \"LOCAL\" CANNOT CHANGE THE MODE OF A VARIABLE; A\n\t\tVARIABLE MUST BE NORMAL, AN ARRAY, OR SUBROUTINE\n\t\tIN ALL CONTEXTS.\n\t* \"INITBASIC\" IS NOT MEANT TO RESET THE INTERPRETER\n\nCOMPILING AND INTERPRETING:\n\tIF GIVEN A FILE, WE BEGIN IN COMPILED MODE\n\tIF NO FILE IS GIVEN, WE BEGIN IN INTERPRETED MODE\n\t\"CPC\" IS THE \"PC\" OF THE NEXT INSTRUCTION TO COMPILE\n\t\"IPC\" IS THE BEGINNING OF TEMPORARY INTERPRETED CODE\n\t\"OPC\" IS THE PC TO RETURN TO AFTER INTERPRETED CODE IS RUN\n\tA STATMENT IS COMPILED IN EITHER MODE\n\tAFTER A STATEMENT IS COMPILED, IT IS RUN IN I-MODE BY:\n\t\tSETTING \"PC\" TO \"IPC\"\n\t\tEMITTING A \"STOP_\"\n\t\tRUNNING THE DRIVER\n\t\tRESTORING THE \"PC\" AND \"CPC\"\n\tCOMPLEX STATEMENTS LIKE IF SET ENTER COMPILED MODE\n\t* \"OPC\" IS NULL IF \"BREAK\" IS RUN FROM COMPILED CODE\n\t* \"RESUME\" WITH A VALUE FOR EXPRESSIONS NOT STATEMENTS\n\nSUBROUTINES:\n\tC-STACK: {JMP}\n\tSTACK: {LINK,SAVED...}\n\tSUBROUTINE DESCRIPTOR:\n\t\tTOTAL LOCALS\n\t\tPARAM COUNT\n\t\tINDEXES OF PARAMS\n\tVALUE OF A SUBROUTINE IS IT'S PC\n\tCALL TAKES VARIABLE INDEX\n\t* NO DISTINCTION BETWEEN FUNCTIONS AND SUBROUTINES\n\t* LOCALS MAY ONLY BE USED INSIDE OF A SUBROUTINE\n\t* TRYING TO USE THEM OUTSIDE WILL NOT REPORT AN ERROR\n\nWHILE:\tC-STACK: {TEST-FALSE-BRANCH, TOP}\n\nFOR:\n\tC-STACK: {TEST-FALSE-BRANCH, I, TOP}\n\tSTACK:\t{HI}\n\t* \"FOR_\" AND \"NEXT_\" INSTRUCTIONS DROP THE HI VALUE\n\t\tFROM THE STACK ON FAILURE AND INCREMENT\n\nDIMENSIONS:\n\tTHE VALUE OF A DIM IS A POINTER\n\tTHE LENGTH OF THE DIM IS STORED IN THE FIRST CELL\n\t\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwillia3%2FBASIC","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwillia3%2FBASIC","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwillia3%2FBASIC/lists"}