Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
8260951
refactor(Documentation): Moved LICENSE to root, and moved function in…
vitorsubhi Jul 10, 2023
fba2900
delete(Unecessary): Removed unnecessary test files from root directory
vitorsubhi Jul 10, 2023
50c62c9
delete(Unecessary): Removed unnecessary test files from gcc_llvm folder
vitorsubhi Jul 10, 2023
aaef1f3
feat(gitkeep): Added .gitkeep file to keep test/out directory empty
vitorsubhi Jul 10, 2023
cc034ab
delete(Unecessary): Removed unnecessary test files from compare direc…
vitorsubhi Jul 10, 2023
116c4fa
feat(Malloc): Initial commit of dynamic allocation
vitorsubhi Jul 10, 2023
5f9f38e
feat(Tests): Updated tests to reach main adjustments
vitorsubhi Jul 10, 2023
17b3111
doc(src): Added folder to .o files and a .gitkeep
vitorsubhi Jul 10, 2023
af1b9c0
remove(OLD): Deleted old main, and node files. They're no longer nece…
vitorsubhi Jul 10, 2023
25c2e39
update(Test): Adjusted remaining tests
vitorsubhi Jul 10, 2023
41f8a30
fix(Tests): Renamed Test, and removed print
vitorsubhi Jul 11, 2023
5e7548a
feat(ExternDeclaration): Added feature to call Extern Function Declar…
vitorsubhi Jul 11, 2023
d674e74
fix(ExternDeclaration): Added missing Header to Extern Function Decla…
vitorsubhi Jul 11, 2023
c674495
test(Bellmanford): Added sample to extern function call
vitorsubhi Jul 11, 2023
da144be
feat(Extern): Adjusted Extern to config extern function type
vitorsubhi Jul 11, 2023
81f17dd
feat(test): Adjusted test files, with print extern
vitorsubhi Jul 11, 2023
ec41697
Partial implementation of register fields (missing load impl) and sta…
thborges Jul 17, 2023
9f01398
Fix linux packaging of platformio.
thborges Jul 13, 2023
4df957a
Add dwarf debug information
thborges Jul 18, 2023
8ba9bfd
Enable debug symbols emission in some Nodes and small fixes.
thborges Jul 19, 2023
41cfc5f
simple debug .rob
thborges Jul 19, 2023
7d39a04
Implement asm keyword (used in interruption tables) and fixes.
thborges Jul 20, 2023
80587c5
Update platformio toolchain and add a semantic check for wrong number…
thborges Jul 20, 2023
b152070
Implements complex identifiers in Load and other fixes. Forces if and…
thborges Jul 21, 2023
23c87eb
One parser (flex) and two scanners (bison) working together. Will pro…
thborges Jul 22, 2023
d957142
New language features and general refactoring.
thborges Aug 6, 2023
b3693c6
Implements test cases, fixes debugging of avr and other general fixes.
thborges Aug 9, 2023
0efc244
Fixes and impls to build robcmp on Windows, using msys2(mingw-w64)
thborges Aug 11, 2023
460ce28
Implements enum types in the language.
thborges Aug 9, 2023
99f3926
Fixes array/matrix with types and removes some invalid syntax constru…
thborges Aug 12, 2023
0ca8b3c
Partial implementation: implement interface as subtypes
thborges Aug 16, 2023
02734dc
0.2 release.
thborges Aug 18, 2023
c21f192
Merge branch 'add-debug' into Organization
thborges Aug 20, 2023
ec8eb35
Merge branch 'Organization' into add-debug
thborges Aug 20, 2023
497e462
Merge branch 'add-debug' into Organization
thborges Aug 20, 2023
8c37c64
Fixes load array after merging pull request.
thborges Aug 20, 2023
aaf15f5
Fixes failing tests using type/interface.
thborges Aug 20, 2023
8b199fb
Rename special function names using # to : due to incompatibility wit…
thborges Aug 28, 2023
5b76f01
Support structures to injection
thborges Sep 14, 2023
ba93b8d
Hardware specification merge
thborges Sep 14, 2023
5c572c4
Add injections to global scope
yagodematos Sep 26, 2023
779654e
First functional injection without linker \o/
thborges Sep 28, 2023
f4af14d
Fix test with .spec file and other small fixes.
thborges May 10, 2024
c1f5818
Script to build avr-gdb: adding support M1 Apple
thborges May 22, 2024
a357ed2
Implements the support for arrays in function calls and other small f…
thborges May 23, 2024
91cf03b
Improves boolean support in the language; fix returning of type insta…
thborges May 25, 2024
974e6a1
Extend array support in the language and some fixes.
thborges May 25, 2024
df848ef
Refactoring array operations: simplify and remove duplicated code.
thborges May 26, 2024
3fe4782
Implements the support for matrices in function calls and other small…
thborges May 28, 2024
8666148
Implements matrix copy and minor fixes
thborges May 29, 2024
aadb80a
Adjusts tests according to the new array/matrix features
thborges May 29, 2024
774a96d
Injections now working on simavr with ssd1306 \o/
thborges Jun 2, 2024
6b657e9
Fixes for llvm 18: ConstantExpr methods is being unsupported.
thborges May 10, 2024
5f2f569
Fix constant fold test for llvm18: unsupported << operator
thborges May 23, 2024
7377f66
Add signal.h for linux build and bump toolchain to llvm-18 tools
thborges May 23, 2024
f034493
Fix test execution on Ubuntu
thborges May 29, 2024
750a159
Add missing memcpy function in assembly and small fixes on linking.
thborges Jun 12, 2024
944af9e
Add sintaxe highlights for unsigned suffix and some keywords.
thborges Jun 12, 2024
db62bc6
Refactoring coercion and supporting unsigned numbers; also improves d…
thborges Jun 12, 2024
c7f9979
Improving language: integer/float exponent syntax
thborges Jun 15, 2024
aec4b3f
The start of our standard lib
thborges Jun 15, 2024
e2ad2af
Fixes and improves stm32 support.
thborges Jun 21, 2024
bf02fce
Allows empty void functions.
thborges Jun 22, 2024
5d93813
Fixes parent field setting and improves/fixes debug information
thborges Jun 22, 2024
2707f95
Fixes stm32f1 i2c speed to 400Mhz. Now working in -Oz -O3 and -O0 (ad…
thborges Jun 22, 2024
afc35c4
Fixes dispatch generation while building nested types; allow function…
thborges Jun 23, 2024
40f8eb9
Fix PropagateTypes on FunctionCall parameters.
thborges Jun 23, 2024
c4029d9
Fixes avr linking with naked functions and implements string constant…
thborges Jun 24, 2024
28de518
Improves injections error messages
thborges Jun 25, 2024
edf53e0
Add int9 type to support some registers in stm32.
thborges Jun 30, 2024
c5bacea
Fixes injection to use the interface dispatcher. This solves errors w…
thborges Jun 30, 2024
53afcd5
Improved debug info, add & and | operators to matrix update, allow lo…
thborges Jun 30, 2024
fa4be3e
Add two test cases that we should support. Still failing.
thborges Jun 30, 2024
f1e053e
Implements boolean short-circuit evaluation.
thborges Jul 1, 2024
771ff40
Enables accessing fields of a nested type in the parent; minor fixes.
thborges Jul 1, 2024
8454aa7
Improves the std lib for the breakout game (sending to ssd1306 only t…
thborges Jul 1, 2024
78f9e27
Fixes short-circuit boolean evaluation for constants.
thborges Jul 6, 2024
39f55a6
Add signal attribute to functions. This is part of interruptions hand…
thborges Jul 6, 2024
cec8b78
Simplifies NamedConst creation by removing redundant location.
thborges Jul 7, 2024
f24fdeb
Add language feature: provide a builtin function typeid to check obje…
thborges Jul 7, 2024
c000e39
Fixes the access of parent fields from nested types; remove : prefix …
thborges Jul 7, 2024
23d6e13
Fixes short-circuit boolean for boolean expressions in variables and …
thborges Jul 7, 2024
48edbe4
Fixes to support interface global variables.
thborges Jul 7, 2024
e9f2c58
Improves coercion/cast handling/messages. Disabling some unsigned <->…
thborges Jul 7, 2024
d1ea6ab
Feature: debug only functions - support to assert.
thborges Jul 7, 2024
c119fcc
Add Interrupts support and improvements in the standard lib. Renames …
thborges Jul 7, 2024
b55cb6a
Missing changes on string constants and avr328p to atmega328p renaming.
thborges Sep 5, 2024
dab973c
Allow building and debugging in vscode for native platform.
thborges Sep 25, 2024
a220bbb
Add basic float support to atmega and implements a bitcast operator
thborges Sep 30, 2024
6024488
Fixes to build with LLVM19
thborges Sep 30, 2024
b13a816
Added float_to_int32 and float_to_64 assembly support on atmega328p.
thborges Oct 3, 2024
b387d08
Fix declaration of string variable initialized by string constant and…
thborges Oct 19, 2024
6a16d8c
Fix build of function calls with string constants.
thborges Oct 30, 2024
d6c3db4
Initial support to avr1284p; add test folder to stm32f1.
thborges Nov 9, 2024
3762676
Small fix when passing array as argument to function. When the array …
thborges Nov 9, 2024
fdcd29e
Missing stm32 functions.
thborges Nov 19, 2024
61d854b
Fix function call passing array size.
thborges Nov 28, 2024
cb4b22d
Basic float support to stm32f1, using pre-built libgcc.
thborges Dec 4, 2024
752a911
Add stm32f1 test sample with uart.
thborges Dec 4, 2024
1d23910
fix(CMAKE): add support to monolithic library systems, such as Arch
vitorsubhi Apr 8, 2025
98ab7b8
Add support to recursive field access: read, write and method call.
thborges Apr 27, 2025
bcca9cc
Improves code generation removing unneeded nested type parent field
thborges May 3, 2025
963043e
Move semantic related files to a specific folder in src.
thborges May 3, 2025
84933bc
Conditionally add typeid fields to types that really need it, improvi…
thborges May 3, 2025
6a03d18
Fixes global string var access
thborges May 20, 2025
6375acc
Reorder IdentifyVirtualDispatch to run after PropagateTypes. Fix erro…
thborges Jun 2, 2025
9c88522
Fix master mode for avr5 mcus, intermittent failures
thborges Jun 6, 2025
8a17838
Improve inline asm to support inputs.
thborges Jun 7, 2025
92e4a55
Fix and expand dependency injection: preparing to sblp2025
thborges Jun 7, 2025
abb775d
Enables setting upload_speed in platformio.ini
thborges Jun 13, 2025
c5c3659
Implements array and matrices of types.
thborges Jun 22, 2025
a7f9af1
Silent LLVM20 messages about getPointerTo.
thborges Jun 22, 2025
f0955ab
Support raspberry pico rp2040: blink led working
thborges Jun 15, 2025
fdafb7f
Fix the usage of the same var name in multiple contexts
thborges Jun 23, 2025
679d65f
Improves AST printing
thborges Jun 25, 2025
8468a98
Improves and fixes grammar for boolean short circuit evaluation
thborges Jun 25, 2025
bc95eb7
Small fixes and improvements integrating rp2040
thborges Jun 25, 2025
fa1700d
Alterações nos arquivos de conf
RayssaIssa Aug 29, 2025
3c4f8fd
Criação da função Atoi e seu arquivo de teste, criação da interface p…
RayssaIssa Aug 29, 2025
29703f5
Alterações em toolchain-robcmp
RayssaIssa Dec 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 17 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@

# Debug files
*.dSYM/
.cache/

# Generated
robcmp
bison.hpp
run_test/out/*
src/Language_y.output
src/*_y.output
src/*_gen_*.*
src/*_gen.y
src/*_l.cpp
.vscode/**
*.tar.gz
*.bin
Expand All @@ -58,3 +61,15 @@ llvm-objcopy
llvm-ranlib
avr-ld
.vscode
refdatasheets
build
test/general/out
test/general/temp.spec
test/atmega328p/out
test/atmega1284p/out
test/stm32f1/out
platformio/toolchain-robcmp/bin
platformio/toolchain-robcmp/lib
platformio/avr-gdb-build
Documentation
hack
83 changes: 83 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
cmake_minimum_required(VERSION 3.20.0)
cmake_policy(SET CMP0054 NEW)

set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0 -fno-exceptions")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -fno-exceptions")
add_compile_definitions()

project(robcmp)

set(CMAKE_CXX_STANDARD 17)

message(STATUS "CC Compiler used: ${CC}")

find_package(LLVM REQUIRED CONFIG)
find_package(FLEX 2.6 REQUIRED)
find_package(BISON 3.8 REQUIRED)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

include_directories(${LLVM_INCLUDE_DIRS} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
add_definitions(${LLVM_DEFINITIONS_LIST})

file(GLOB robcmp_SRC CONFIGURE_DEPENDS
"src/*.cpp"
"src/**/*.cpp"
)

flex_target(lexer "${CMAKE_CURRENT_SOURCE_DIR}/src/Language.l" "${CMAKE_BINARY_DIR}/Language_l.cpp")

bison_target(scanner_main
"${CMAKE_BINARY_DIR}/Language_gen.y"
"${CMAKE_BINARY_DIR}/Language_gen.cpp"
DEFINES_FILE "${CMAKE_BINARY_DIR}/Language_gen_y.hpp"
COMPILE_FLAGS "-Wall -Wno-deprecated")
bison_target(scanner_use
"${CMAKE_BINARY_DIR}/LanguageUse_gen.y"
"${CMAKE_BINARY_DIR}/LanguageUse_gen.cpp"
COMPILE_FLAGS "-Wall -Wno-deprecated")

# Language_gen.y
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/Language_gen.y
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/src/LanguageHeader.y ${CMAKE_CURRENT_SOURCE_DIR}/src/Language.y > ${CMAKE_BINARY_DIR}/Language_gen.y
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/LanguageHeader.y ${CMAKE_CURRENT_SOURCE_DIR}/src/Language.y
)
# LanguageUse_gen.y
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/LanguageUse_gen.y
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/src/LanguageHeader.y ${CMAKE_CURRENT_SOURCE_DIR}/src/LanguageUse.y > ${CMAKE_BINARY_DIR}/LanguageUse_gen.y
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/LanguageHeader.y ${CMAKE_CURRENT_SOURCE_DIR}/src/LanguageUse.y
)
add_custom_target(parsers
DEPENDS ${CMAKE_BINARY_DIR}/Language_gen.y ${CMAKE_BINARY_DIR}/LanguageUse_gen.y)

add_executable(robcmp
${FLEX_lexer_OUTPUTS}
${BISON_scanner_main_OUTPUTS} ${BISON_scanner_use_OUTPUTS}
${robcmp_SRC})

add_flex_bison_dependency(lexer scanner_main)
add_flex_bison_dependency(lexer scanner_use)
add_dependencies(robcmp parsers)

find_library(LLVM_MONOLITHIC_LIBRARY LLVM HINTS ${LLVM_LIBRARY_DIRS})

if (LLVM_MONOLITHIC_LIBRARY)
message(STATUS "LLVM is using monolithic libLLVM.so")
target_link_libraries(robcmp LLVM)
else()
llvm_map_components_to_libnames(llvm_libs support core irreader passes
armasmparser armcodegen
avrasmparser avrcodegen
x86asmparser x86codegen)

target_link_libraries(robcmp ${llvm_libs})
endif()

set_target_properties(robcmp PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
VS_DEBUGGER_COMMAND_ARGUMENTS "-a atmega328p -Oz ../platformio/samples/atmega328p-blink/src/main.rob")
123 changes: 0 additions & 123 deletions Documentation/info

This file was deleted.

18 changes: 0 additions & 18 deletions Ex1.txt

This file was deleted.

File renamed without changes.
30 changes: 21 additions & 9 deletions Makefile → Makefile.old
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,47 @@ COMPILER_NAME=$(shell basename "${PWD}")
SRC = src
BIN = .

FLAGS=-O3 -march=native -flto
#DFLAGS=-ggdb -O0
#FLAGS=-O3 -march=native -flto
DFLAGS=-ggdb -O0 -std=c++17

SCANNERS=src/Language_gen.y src/LanguageUse_gen.y
CPPS=$(patsubst src/%.cpp,src/out/%.o,$(wildcard ${SRC}/*.cpp))
YACS=$(patsubst src/%.y,src/out/%_y.o,$(wildcard ${SRC}/*.y))
YACS=$(patsubst src/%.y,src/out/%_y.o,$(SCANNERS))
LEXS=$(patsubst src/%.l,src/out/%_l.o,$(wildcard ${SRC}/*.l))

all: src/out $(COMPILER_NAME)

%_l.cpp: %.l
lex -o $@ $<
flex -o $@ $<

.PRECIOUS : %_l.cpp %_y.cpp %_y.hpp
.SECONDARY : $(SCANNERS)

-include $(CPPS:%.o=%.d)

main.cpp : %_l.cpp %_y.cpp %_y.hpp

%_gen.y : src/LanguageHeader.y %.y
-chmod u+w $@
cat $^ > $@
chmod u-w $@

%_y.cpp: %.y
bison -Wall --report=state --defines=$(SRC)/bison.hpp -o $@ $<
bison -Wall --defines=$(patsubst %.cpp,%.hpp,$@) -o $@ $<
$(SED) 's/\"syntax\ error\"/COLOR_RED\ \"syntax\ error\"\ COLOR_RESET/' -i $@
$(SED) 's/\"syntax\ error:/COLOR_RED\ \"syntax\ error:\"\ COLOR_RESET\"/' -i $@
$(SED) 's/\"syntax\ error,/COLOR_RED\ \"syntax\ error:\"\ COLOR_RESET\"/' -i $@

$(COMPILER_NAME): ${YACS} ${LEXS} ${CPPS}
${CC} -std=c++11 ${FLAGS} ${DFLAGS} ${SRC}/out/*.o ${LLVMLIBS} -o $(BIN)/$@
${CC} ${FLAGS} ${DFLAGS} -std=c++17 ${SRC}/out/*.o ${LLVMLIBS} -o $(BIN)/$@

src/out/%.o: src/%.cpp
${CC} -std=c++11 ${LLVMFLAGS} ${FLAGS} ${DFLAGS} -c $< -o $@
${CC} ${LLVMFLAGS} ${FLAGS} ${DFLAGS} -MMD -std=c++17 -c $< -o $@

src/out:
mkdir ${SRC}/out

clean:
rm -f ${SRC}/*_y.cpp ${SRC}/*_l.cpp ${SRC}/bison.hpp ${SRC}/out/*.o
rm -f ${SRC}/*_y.{hpp,cpp} ${SRC}/*_l.{hpp,cpp} ${SRC}/out/*.o

#.SILENT:
.PRECIOUS: bison.hpp
10 changes: 0 additions & 10 deletions Teste_Matrix.txt

This file was deleted.

6 changes: 6 additions & 0 deletions butbuil
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CXX=clang++
CC=clang
export CXX
export CC
cmake -DCMAKE_BUILD_TYPE="Debug" ..
#cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE="Debug" ..
16 changes: 0 additions & 16 deletions compare/Ex1.c

This file was deleted.

18 changes: 0 additions & 18 deletions compare/Ex1.txt

This file was deleted.

19 changes: 0 additions & 19 deletions compare/Ex2.c

This file was deleted.

Loading