Skip to content

Commit

Permalink
gc.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Wodan58 committed Mar 22, 2021
1 parent 4ff49ff commit 758efec
Show file tree
Hide file tree
Showing 283 changed files with 3,566 additions and 3,187 deletions.
90 changes: 90 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
Language: Cpp
# BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: All
BreakBeforeBraces: WebKit
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp03
TabWidth: 8
UseTab: Never
...

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ script:
- cmake --build .

after_success:
- lcov --directory . --capture --output-file coverage.info # capture coverage info
- lcov --remove coverage.info 'bdwgc/*' '/usr/*' --output-file coverage.info # filter out system, test, and external code
- lcov --capture --base-directory . --directory . --output-file coverage.info # capture coverage info
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system, test, and external code
- lcov --list coverage.info # debug before upload
- coveralls-lcov coverage.info # uploads to coveralls
- bash <(curl -s https://codecov.io/bash)
25 changes: 19 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#
# module : CMakeLists.txt
# version : 1.17
# date : 01/25/21
# version : 1.19
# date : 03/15/21
#
cmake_minimum_required(VERSION 3.0)
project(Moy VERSION 1.0)
set(CMAKE_BUILD_TYPE Release)
option(REAL_BDW "Use BDW garbage collector" OFF)
option(RUN_TESTS "Run standard tests" OFF)
find_package(BISON)
find_package(FLEX)
Expand All @@ -18,17 +19,29 @@ FLEX_TARGET(MyScanner lexer.l lexer.c)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage") # debug, no optimization
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") # enabling coverage
endif()
include_directories(. src bdwgc/include)
add_subdirectory(bdwgc)
if(REAL_BDW)
add_definitions(-DGC_BDW)
include_directories(bdwgc/include src .)
add_executable(joy main.c ${BISON_MyParser_OUTPUTS} ${FLEX_MyScanner_OUTPUTS}
joy.c compile.c initsym.c interp.c optable.c outfile.c print.c
symbol.c utils.c dict.c memory.c node.c scan.c srand.c rand.c
tmpfile.c)
symbol.c dict.c node.c scan.c srand.c rand.c tmpfile.c utils.c)
if(WIN32)
target_link_libraries(joy gc-lib)
else()
target_link_libraries(joy gc-lib m)
endif()
add_subdirectory(bdwgc)
else()
include_directories(src .)
add_executable(joy main.c ${BISON_MyParser_OUTPUTS} ${FLEX_MyScanner_OUTPUTS}
joy.c compile.c initsym.c interp.c optable.c outfile.c print.c
symbol.c dict.c node.c scan.c srand.c rand.c tmpfile.c utils.c
gc.c)
if(WIN32)
else()
target_link_libraries(joy m)
endif()
endif()
add_dependencies(joy always)
add_custom_target(always
COMMAND sh banner.sh ${PROJECT_NAME} ${PROJECT_VERSION}
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,27 @@ status|[![Travis CI build status](https://travis-ci.com/Wodan58/Moy.svg?branch=m

This project implements a variant of [Joy](https://github.com/Wodan58/joy1).
Conditions do not restore the stack to what it was before the condition
started. This project depends on the
started. This project uses the
[BDW garbage collector](https://github.com/ivmai/bdwgc).

Changes
-------

Most builtins of Joy are supported in Moy.
Some other ones have been added: casting, fget, filetime, getch, index, over,
pick, round, and sametype.
Some other ones have been added: casting, fget, filetime, getch, identical,
in1, index, over, pick, round, and sametype.
The build system requires new builtins in only one location: as a .c file in
the src-directory.

Installation
------------

In addition to the BDW garbage collector, it is wise to install CMake. Then run:
Run:

ln -s ../bdwgc
cmake .
cmake --build .

And run:
And:

cd lib
make -f regres.mak
Loading

0 comments on commit 758efec

Please sign in to comment.