-
Notifications
You must be signed in to change notification settings - Fork 0
Adding the Sweet transpiler #60
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
Open
maju-degrandi
wants to merge
27
commits into
develop
Choose a base branch
from
sweet-transpiler
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
5a54e2b
alterações com a maju
arthurvergacas a02ddbc
alterações com a maju
arthurvergacas 1fb6349
Merge branch 'sweet-transpiler' of https://github.com/vinumdoc/vinum …
maju-degrandi 60eadbf
Fazendo transpilação a partir do bison
maju-degrandi 90445fd
Fixing compilation error
maju-degrandi 7679df9
Simple cases are working
maju-degrandi 5942fff
All block types are working now - including nested blocks
maju-degrandi ebf7041
Fixing minor errors on lex
maju-degrandi 2e71f1a
Fixing chained calls error
maju-degrandi 821c816
meson: Add support for older versions (>=0.61.2)
Grillo-0 156d29d
Refactor tokenizer and parser for correct sweet syntax recognition an…
maju-degrandi 3881362
Merge pull request #58 from vinumdoc/old-meson
Grillo-0 f5c7baa
Revert "vinumc: reuse args rule to define a program's children"
JeanJPNM 8cb6e22
Merge pull request #61 from vinumdoc/revert-55-fix/48/word-as-program…
Grillo-0 3e55ea4
fix: prevent external calls from being skipped
JeanJPNM 1378c5e
Merge pull request #68 from vinumdoc/ensure-external-call-args-node
monacofj c6f6fd9
vinumc/tests: add test_call_no_args to test suite
JeanJPNM b597095
Merge pull request #69 from vinumdoc/test-no-args-extern-calls
Grillo-0 7088d81
alterações com a maju
arthurvergacas ea16042
Fazendo transpilação a partir do bison
maju-degrandi e89cd59
Fixing compilation error
maju-degrandi 0bc57b3
Simple cases are working
maju-degrandi 04a6b9e
All block types are working now - including nested blocks
maju-degrandi f5bea13
Fixing minor errors on lex
maju-degrandi 6f52b25
Fixing chained calls error
maju-degrandi 943ec51
Refactor tokenizer and parser for correct sweet syntax recognition an…
maju-degrandi f720400
Merge branch 'sweet-transpiler' of https://github.com/vinumdoc/vinum …
maju-degrandi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| AC_INIT([vinum], [1.0]) | ||
| AM_INIT_AUTOMAKE([foreign -Wall -Werror]) | ||
|
|
||
| CFLAGS="" | ||
| AC_PROG_CC | ||
|
|
||
| AC_PROG_YACC | ||
| AC_PROG_LEX(noyywrap) | ||
|
|
||
| AC_CONFIG_HEADERS([config.h]) | ||
| AC_CONFIG_FILES([Makefile src/Makefile]) | ||
| AC_OUTPUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| AM_CFLAGS = -Wall -Wextra -Werror -g | ||
| AM_YFLAGS = -d | ||
|
|
||
| bin_PROGRAMS = vinumc sweet_vinumc | ||
|
|
||
| BUILT_SOURCES = dry_bison.h sweet_bison.h | ||
|
|
||
| vinumc_SOURCES = \ | ||
| ast.c \ | ||
| ast_bison_helpers.c \ | ||
| dry_bison.y \ | ||
| dry_flex.l \ | ||
| eval.c \ | ||
| vinumc.c | ||
|
|
||
| sweet_vinumc_SOURCES = \ | ||
| sweet_bison.y \ | ||
| sweet_flex.l \ | ||
| sweet_vinumc.c | ||
|
|
||
| CLEANFILES = \ | ||
| sweet_flex.c \ | ||
| sweet_bison.c | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,236 @@ | ||
| This file contains any messages produced by compilers while | ||
| running configure, to aid debugging if configure makes a mistake. | ||
|
|
||
| It was created by vinum configure 1.0, which was | ||
| generated by GNU Autoconf 2.71. Invocation command line was | ||
|
|
||
| $ ../configure | ||
|
|
||
| ## --------- ## | ||
| ## Platform. ## | ||
| ## --------- ## | ||
|
|
||
| hostname = compiuter | ||
| uname -m = x86_64 | ||
| uname -r = 5.15.167.4-microsoft-standard-WSL2 | ||
| uname -s = Linux | ||
| uname -v = #1 SMP Tue Nov 5 00:21:55 UTC 2024 | ||
|
|
||
| /usr/bin/uname -p = x86_64 | ||
| /bin/uname -X = unknown | ||
|
|
||
| /bin/arch = x86_64 | ||
| /usr/bin/arch -k = unknown | ||
| /usr/convex/getsysinfo = unknown | ||
| /usr/bin/hostinfo = unknown | ||
| /bin/machine = unknown | ||
| /usr/bin/oslevel = unknown | ||
| /bin/universe = unknown | ||
|
|
||
| PATH: /usr/local/sbin/ | ||
| PATH: /usr/local/bin/ | ||
| PATH: /usr/sbin/ | ||
| PATH: /usr/bin/ | ||
| PATH: /sbin/ | ||
| PATH: /bin/ | ||
| PATH: /usr/games/ | ||
| PATH: /usr/local/games/ | ||
| PATH: /usr/lib/wsl/lib/ | ||
| PATH: /mnt/c/Windows/system32/ | ||
| PATH: /mnt/c/Windows/ | ||
| PATH: /mnt/c/Windows/System32/Wbem/ | ||
| PATH: /mnt/c/Windows/System32/WindowsPowerShell/v1.0/ | ||
| PATH: /mnt/c/Windows/System32/OpenSSH/ | ||
| PATH: /mnt/c/Program Files/dotnet/ | ||
| PATH: /mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR/ | ||
| PATH: /mnt/c/WINDOWS/system32/ | ||
| PATH: /mnt/c/WINDOWS/ | ||
| PATH: /mnt/c/WINDOWS/System32/Wbem/ | ||
| PATH: /mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/ | ||
| PATH: /mnt/c/WINDOWS/System32/OpenSSH/ | ||
| PATH: /mnt/c/Program Files/Git/cmd/ | ||
| PATH: /mnt/c/ProgramData/chocolatey/bin/ | ||
| PATH: /mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common/ | ||
| PATH: /Docker/host/bin/ | ||
| PATH: /mnt/c/Program Files/Go/bin/ | ||
| PATH: /mnt/c/Users/arthu/.cargo/bin/ | ||
| PATH: /mnt/c/Users/arthu/AppData/Local/Microsoft/WindowsApps/ | ||
| PATH: /mnt/c/Users/arthu/AppData/Local/Programs/Microsoft VS Code/bin/ | ||
| PATH: /mnt/c/Program Files/zstd-v1.5.6-win64/ | ||
| PATH: /mnt/c/Users/arthu/go/bin/ | ||
| PATH: /mnt/c/users/arthu/appdata/local/packages/pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0/localcache/local-packages/python312/scripts/ | ||
| PATH: /mnt/c/users/arthu/.local/bin/ | ||
| PATH: /mnt/c/Users/arthu/AppData/Roaming/nvm/ | ||
| PATH: /mnt/c/Program Files/nodejs/ | ||
| PATH: /home/vergacas/.local/bin/ | ||
| PATH: /usr/local/go/bin/ | ||
| PATH: /home/vergacas/.local/bin/ | ||
|
|
||
|
|
||
| ## ----------- ## | ||
| ## Core tests. ## | ||
| ## ----------- ## | ||
|
|
||
| configure:2154: looking for aux files: compile missing install-sh | ||
| configure:2167: trying ../ | ||
| configure:2196: ../compile found | ||
| configure:2196: ../missing found | ||
| configure:2178: ../install-sh found | ||
| configure:2325: checking for a BSD-compatible install | ||
| configure:2398: result: /usr/bin/install -c | ||
| configure:2409: checking whether build environment is sane | ||
| configure:2464: result: yes | ||
| configure:2623: checking for a race-free mkdir -p | ||
| configure:2667: result: /usr/bin/mkdir -p | ||
| configure:2674: checking for gawk | ||
| configure:2695: found /usr/bin/gawk | ||
| configure:2706: result: gawk | ||
| configure:2717: checking whether make sets $(MAKE) | ||
| configure:2740: result: yes | ||
| configure:2770: checking whether make supports nested variables | ||
| configure:2788: result: yes | ||
| configure:2805: error: source directory already configured; run "make distclean" there first | ||
|
|
||
| ## ---------------- ## | ||
| ## Cache variables. ## | ||
| ## ---------------- ## | ||
|
|
||
| ac_cv_env_CC_set= | ||
| ac_cv_env_CC_value= | ||
| ac_cv_env_CFLAGS_set= | ||
| ac_cv_env_CFLAGS_value= | ||
| ac_cv_env_CPPFLAGS_set= | ||
| ac_cv_env_CPPFLAGS_value= | ||
| ac_cv_env_LDFLAGS_set= | ||
| ac_cv_env_LDFLAGS_value= | ||
| ac_cv_env_LIBS_set= | ||
| ac_cv_env_LIBS_value= | ||
| ac_cv_env_YACC_set= | ||
| ac_cv_env_YACC_value= | ||
| ac_cv_env_YFLAGS_set= | ||
| ac_cv_env_YFLAGS_value= | ||
| ac_cv_env_build_alias_set= | ||
| ac_cv_env_build_alias_value= | ||
| ac_cv_env_host_alias_set= | ||
| ac_cv_env_host_alias_value= | ||
| ac_cv_env_target_alias_set= | ||
| ac_cv_env_target_alias_value= | ||
| ac_cv_path_install='/usr/bin/install -c' | ||
| ac_cv_path_mkdir=/usr/bin/mkdir | ||
| ac_cv_prog_AWK=gawk | ||
| ac_cv_prog_make_make_set=yes | ||
| am_cv_make_support_nested_variables=yes | ||
|
|
||
| ## ----------------- ## | ||
| ## Output variables. ## | ||
| ## ----------------- ## | ||
|
|
||
| ACLOCAL='' | ||
| AMDEPBACKSLASH='' | ||
| AMDEP_FALSE='' | ||
| AMDEP_TRUE='' | ||
| AMTAR='' | ||
| AM_BACKSLASH='\' | ||
| AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' | ||
| AM_DEFAULT_VERBOSITY='1' | ||
| AM_V='$(V)' | ||
| AUTOCONF='' | ||
| AUTOHEADER='' | ||
| AUTOMAKE='' | ||
| AWK='gawk' | ||
| CC='' | ||
| CCDEPMODE='' | ||
| CFLAGS='' | ||
| CPPFLAGS='' | ||
| CSCOPE='' | ||
| CTAGS='' | ||
| CYGPATH_W='' | ||
| DEFS='' | ||
| DEPDIR='' | ||
| ECHO_C='' | ||
| ECHO_N='-n' | ||
| ECHO_T='' | ||
| ETAGS='' | ||
| EXEEXT='' | ||
| INSTALL_DATA='${INSTALL} -m 644' | ||
| INSTALL_PROGRAM='${INSTALL}' | ||
| INSTALL_SCRIPT='${INSTALL}' | ||
| INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' | ||
| LDFLAGS='' | ||
| LEX='' | ||
| LEXLIB='' | ||
| LEX_OUTPUT_ROOT='' | ||
| LIBOBJS='' | ||
| LIBS='' | ||
| LTLIBOBJS='' | ||
| MAKEINFO='' | ||
| MKDIR_P='/usr/bin/mkdir -p' | ||
| OBJEXT='' | ||
| PACKAGE='' | ||
| PACKAGE_BUGREPORT='' | ||
| PACKAGE_NAME='vinum' | ||
| PACKAGE_STRING='vinum 1.0' | ||
| PACKAGE_TARNAME='vinum' | ||
| PACKAGE_URL='' | ||
| PACKAGE_VERSION='1.0' | ||
| PATH_SEPARATOR=':' | ||
| SET_MAKE='' | ||
| SHELL='/bin/bash' | ||
| STRIP='' | ||
| VERSION='' | ||
| YACC='' | ||
| YFLAGS='' | ||
| ac_ct_CC='' | ||
| am__EXEEXT_FALSE='' | ||
| am__EXEEXT_TRUE='' | ||
| am__fastdepCC_FALSE='' | ||
| am__fastdepCC_TRUE='' | ||
| am__include='' | ||
| am__isrc=' -I$(srcdir)' | ||
| am__leading_dot='.' | ||
| am__nodep='' | ||
| am__quote='' | ||
| am__tar='' | ||
| am__untar='' | ||
| bindir='${exec_prefix}/bin' | ||
| build_alias='' | ||
| datadir='${datarootdir}' | ||
| datarootdir='${prefix}/share' | ||
| docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' | ||
| dvidir='${docdir}' | ||
| exec_prefix='NONE' | ||
| host_alias='' | ||
| htmldir='${docdir}' | ||
| includedir='${prefix}/include' | ||
| infodir='${datarootdir}/info' | ||
| install_sh='${SHELL} /home/vergacas/ic/vinum/install-sh' | ||
| libdir='${exec_prefix}/lib' | ||
| libexecdir='${exec_prefix}/libexec' | ||
| localedir='${datarootdir}/locale' | ||
| localstatedir='${prefix}/var' | ||
| mandir='${datarootdir}/man' | ||
| mkdir_p='' | ||
| oldincludedir='/usr/include' | ||
| pdfdir='${docdir}' | ||
| prefix='NONE' | ||
| program_transform_name='s,x,x,' | ||
| psdir='${docdir}' | ||
| runstatedir='${localstatedir}/run' | ||
| sbindir='${exec_prefix}/sbin' | ||
| sharedstatedir='${prefix}/com' | ||
| sysconfdir='${prefix}/etc' | ||
| target_alias='' | ||
|
|
||
| ## ----------- ## | ||
| ## confdefs.h. ## | ||
| ## ----------- ## | ||
|
|
||
| /* confdefs.h */ | ||
| #define PACKAGE_NAME "vinum" | ||
| #define PACKAGE_TARNAME "vinum" | ||
| #define PACKAGE_VERSION "1.0" | ||
| #define PACKAGE_STRING "vinum 1.0" | ||
| #define PACKAGE_BUGREPORT "" | ||
| #define PACKAGE_URL "" | ||
|
|
||
| configure: exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| /* A Bison parser, made by GNU Bison 3.8.2. */ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't want the file generated by lex/bison on the repo. Please add the to the .gitignore |
||
|
|
||
| /* Bison interface for Yacc-like parsers in C | ||
| Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, | ||
| Inc. | ||
| This program is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
| You should have received a copy of the GNU General Public License | ||
| along with this program. If not, see <https://www.gnu.org/licenses/>. */ | ||
|
|
||
| /* As a special exception, you may create a larger work that contains | ||
| part or all of the Bison parser skeleton and distribute that work | ||
| under terms of your choice, so long as that work isn't itself a | ||
| parser generator using the skeleton or a modified version thereof | ||
| as a parser skeleton. Alternatively, if you modify or redistribute | ||
| the parser skeleton itself, you may (at your option) remove this | ||
| special exception, which will cause the skeleton and the resulting | ||
| Bison output files to be licensed under the GNU General Public | ||
| License without this special exception. | ||
| This special exception was added by the Free Software Foundation in | ||
| version 2.2 of Bison. */ | ||
|
|
||
| /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, | ||
| especially those whose name start with YY_ or yy_. They are | ||
| private implementation details that can be changed or removed. */ | ||
|
|
||
| #ifndef YY_YY_SWEET_BISON_H_INCLUDED | ||
| # define YY_YY_SWEET_BISON_H_INCLUDED | ||
| /* Debug traces. */ | ||
| #ifndef YYDEBUG | ||
| # define YYDEBUG 0 | ||
| #endif | ||
| #if YYDEBUG | ||
| extern int yydebug; | ||
| #endif | ||
|
|
||
| /* Token kinds. */ | ||
| #ifndef YYTOKENTYPE | ||
| # define YYTOKENTYPE | ||
| enum yytokentype | ||
| { | ||
| YYEMPTY = -2, | ||
| YYEOF = 0, /* "end of file" */ | ||
| YYerror = 256, /* error */ | ||
| YYUNDEF = 257, /* "invalid token" */ | ||
| NAME = 258, /* NAME */ | ||
| CONTENT = 259 /* CONTENT */ | ||
| }; | ||
| typedef enum yytokentype yytoken_kind_t; | ||
| #endif | ||
| /* Token kinds. */ | ||
| #define YYEMPTY -2 | ||
| #define YYEOF 0 | ||
| #define YYerror 256 | ||
| #define YYUNDEF 257 | ||
| #define NAME 258 | ||
| #define CONTENT 259 | ||
|
|
||
| /* Value type. */ | ||
| #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | ||
| union YYSTYPE | ||
| { | ||
| #line 21 "sweet_bison.y" | ||
|
|
||
| char* str; | ||
|
|
||
| #line 79 "sweet_bison.h" | ||
|
|
||
| }; | ||
| typedef union YYSTYPE YYSTYPE; | ||
| # define YYSTYPE_IS_TRIVIAL 1 | ||
| # define YYSTYPE_IS_DECLARED 1 | ||
| #endif | ||
|
|
||
|
|
||
| extern YYSTYPE yylval; | ||
|
|
||
|
|
||
| int yyparse (void); | ||
|
|
||
|
|
||
| #endif /* !YY_YY_SWEET_BISON_H_INCLUDED */ | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use autotools anymore, please use the meson build system