Skip to content
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

Setup structure #1

Open
wants to merge 152 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
aecb7f8
Store RawCLang and Clang for history purposes
PaulN2112CGE Oct 17, 2024
faf8290
Store dumps before removal
PaulN2112CGE Oct 17, 2024
947ac4f
Initial very draft version
PaulN2112CGE Oct 18, 2024
33d69a7
add init
PaulN2112CGE Oct 18, 2024
8fbc4cc
Merge branch 'setup-structure' of github.com:TNO/Renaissance-Experiments
PaulN2112CGE Oct 18, 2024
ee483e3
Add installation procedure
PaulN2112CGE Oct 18, 2024
50abd76
Add a main readme
PaulN2112CGE Oct 18, 2024
cc2091c
Add first simple patterns
PaulN2112CGE Oct 22, 2024
d9dac60
Keep first version of match_finder
PaulN2112CGE Oct 24, 2024
b1d3ddd
Consolidate current efforts. Far from finished yet.
PaulN2112CGE Oct 24, 2024
fe3157c
Merge branch 'setup-structure' of github.com:TNO/Renaissance-Experime…
PaulN2112CGE Oct 24, 2024
d86edb8
Add is_statement
PaulN2112CGE Oct 29, 2024
a161869
move test_utils to it's own file
PaulN2112CGE Oct 29, 2024
823fac2
Document match finder
PaulN2112CGE Oct 29, 2024
69dd6c3
add c_cpp utils and factories
PaulN2112CGE Oct 29, 2024
35cadf9
add tests for finder and c_pattern_factory
PaulN2112CGE Oct 29, 2024
d9e6825
use is_unexposed() method
PaulN2112CGE Oct 29, 2024
24be2a8
Add Unary operator behavior
PaulN2112CGE Oct 29, 2024
9a27653
Remove hardwired dependencies to clang
PaulN2112CGE Oct 29, 2024
028ce29
Reorganize
PaulN2112CGE Oct 29, 2024
85daa3c
Do not return name for call expressions
PaulN2112CGE Oct 31, 2024
85c8be4
Add clang json
PaulN2112CGE Oct 31, 2024
a4b2e78
Support both clang and clang json
PaulN2112CGE Oct 31, 2024
973fc3f
Correctly handle duplicate keys
PaulN2112CGE Oct 31, 2024
133974e
Generalize for clang json
PaulN2112CGE Oct 31, 2024
79aa13c
Generalize and add unary operators
PaulN2112CGE Oct 31, 2024
98d6e3c
Stored unfinished gcc attempt for possible later use
PaulN2112CGE Nov 5, 2024
90593d0
Delete gcc attempt
PaulN2112CGE Nov 5, 2024
2095aad
Add rewriter and stream
PaulN2112CGE Nov 8, 2024
47e4aef
set scope for clang and clang json
PaulN2112CGE Nov 8, 2024
2f66d56
Add rewriter
PaulN2112CGE Nov 8, 2024
b3c1762
Add test for rewriter
PaulN2112CGE Nov 8, 2024
a5b6a8f
Conform to python conventions
PaulN2112CGE Nov 8, 2024
4538f2b
Add test for AstRewriter
PaulN2112CGE Nov 8, 2024
c239c12
Add examples
PaulN2112CGE Nov 8, 2024
9a985df
Add a simple cpp class for test
PaulN2112CGE Nov 8, 2024
43bea3b
Update readme with todo's
PaulN2112CGE Nov 8, 2024
9fc6361
Cleanup unused files
PaulN2112CGE Nov 8, 2024
5e00b71
make sure that ast_node has no public abstract methods
PaulN2112CGE Nov 12, 2024
51a96c1
intergration tests
PaulN2112CGE Nov 12, 2024
957c740
made compilable
PaulN2112CGE Nov 12, 2024
ac459c8
add coverage
PaulN2112CGE Nov 12, 2024
d9d74f2
Add references and _ protected overrides
PaulN2112CGE Nov 12, 2024
8b41bde
matches_kind public
PaulN2112CGE Nov 12, 2024
711cef0
add name and optionally include properties
PaulN2112CGE Nov 12, 2024
b6dffeb
deal with empty lines in remove
PaulN2112CGE Nov 12, 2024
7d1ef80
use atu for resolving types
PaulN2112CGE Nov 12, 2024
345ec15
add TestUseAtuToCreatePatterns
PaulN2112CGE Nov 12, 2024
5353f3f
add an example to remove unused variables
PaulN2112CGE Nov 12, 2024
bdd8d36
test use factory to create patterns
PaulN2112CGE Nov 12, 2024
a0666ff
Don't use List use list
PaulN2112CGE Nov 13, 2024
c294f21
store kind of reference add testcase for call,baseclass,typeref refer…
PaulN2112CGE Nov 13, 2024
9c47ba2
use Sequence wherever possible
PaulN2112CGE Nov 14, 2024
127784b
Improve types
PaulN2112CGE Nov 14, 2024
2a4037f
add Stream tests
PaulN2112CGE Nov 14, 2024
01c4e3e
use ASTNode iso 'ASTNode'
PaulN2112CGE Nov 14, 2024
5d9697c
Clarify the reason for public methods not abstract
PaulN2112CGE Nov 14, 2024
4e5373e
Remove print
PaulN2112CGE Nov 14, 2024
994c9c2
Better names
PaulN2112CGE Nov 15, 2024
8fff2d5
Generate with preprocessing data, add macro_expansion to get_properties
PaulN2112CGE Nov 15, 2024
e630b5a
add macro_expansion to properties
PaulN2112CGE Nov 15, 2024
0269268
Use Sequence iso list
PaulN2112CGE Nov 15, 2024
4a53f2f
Skip Macro and inclusion directive to determine offset
PaulN2112CGE Nov 15, 2024
d3672a7
get_names return Sequence
PaulN2112CGE Nov 15, 2024
8d19d00
Add TestUseAtuToCreatePattern
PaulN2112CGE Nov 15, 2024
99c164a
add navigation methods, add stripped get_text() and get_extended_off…
PaulN2112CGE Nov 19, 2024
e49849b
include ';' for statements (to ease refactoring)
PaulN2112CGE Nov 19, 2024
22adf9f
use new get_text()
PaulN2112CGE Nov 19, 2024
d540add
include function declarations
PaulN2112CGE Nov 19, 2024
6f595ac
use Sequence iso list
PaulN2112CGE Nov 19, 2024
b14d1d9
use new get_text
PaulN2112CGE Nov 19, 2024
64e3363
log if only properties do not match. used new get_text
PaulN2112CGE Nov 19, 2024
961e3d5
introduce TextUtils
PaulN2112CGE Nov 19, 2024
57cf314
introduces TextUtils
PaulN2112CGE Nov 19, 2024
5c9e301
Allow for next compositions
PaulN2112CGE Nov 19, 2024
c1a7e4e
add example for nested compositions, also using atu in pattern factory
PaulN2112CGE Nov 19, 2024
553773a
peek agnostic of result
PaulN2112CGE Nov 20, 2024
1896b2b
use root for reference determination
PaulN2112CGE Nov 20, 2024
45566d1
reuse pattern
PaulN2112CGE Nov 20, 2024
2c0f837
add has_changed
PaulN2112CGE Nov 20, 2024
29165c5
create an umbrella class for easy refactoring
PaulN2112CGE Nov 20, 2024
815dbca
publish ASTRefactor
PaulN2112CGE Nov 20, 2024
e9ea8cf
add an example for a refactor method
PaulN2112CGE Nov 20, 2024
60bb5ff
Showcase remove unused variable as a refactor action
PaulN2112CGE Nov 20, 2024
ebbc1d2
reuse AstNodeType
PaulN2112CGE Nov 20, 2024
bb8916b
Parse compilation database and pass args and dir to loaders
PaulN2112CGE Nov 20, 2024
521a041
add working_dir
PaulN2112CGE Nov 20, 2024
7f3a285
publish CompilationDatabase
PaulN2112CGE Nov 20, 2024
6e12b31
Add an example compilation database
PaulN2112CGE Nov 20, 2024
9bec427
Example for walking compilation database
PaulN2112CGE Nov 20, 2024
bab3395
Check comment of preceding node as starting point
PaulN2112CGE Nov 21, 2024
112a1d6
interface and encoding changes
PaulN2112CGE Nov 21, 2024
d4777c2
add get_ancestor and encoding
PaulN2112CGE Nov 21, 2024
7715fc5
add batch processing
PaulN2112CGE Nov 21, 2024
6991670
avoid write text to disk
PaulN2112CGE Nov 21, 2024
84d76a9
use system encoding
PaulN2112CGE Nov 21, 2024
1cc8164
change test to correctly point predecessor comment
PaulN2112CGE Nov 21, 2024
5064009
no return value
PaulN2112CGE Nov 21, 2024
b4489e1
add a batch process example
PaulN2112CGE Nov 21, 2024
a99f828
if include_whitespace==False leave the handling to the inserter
PaulN2112CGE Nov 25, 2024
b53647c
add HasFinalAction
PaulN2112CGE Nov 25, 2024
e781c3b
add parallel processing and remove HasFinalAction ifo recipes
PaulN2112CGE Nov 26, 2024
665cccf
add repeat_step and remove user_objects ifo recipe
PaulN2112CGE Nov 26, 2024
27ef1dc
publish AST_FACTORY_AND ATU and Action
PaulN2112CGE Nov 26, 2024
79f2be6
add recipe_ast_processor to handle recipes
PaulN2112CGE Nov 26, 2024
8d20f84
show_case recipe handling in examples
PaulN2112CGE Nov 26, 2024
683de12
Remove user object
PaulN2112CGE Nov 28, 2024
abfa015
Map action on peek
PaulN2112CGE Dec 2, 2024
0336a14
Add store_node
PaulN2112CGE Dec 2, 2024
f41eb45
Enable concurrency
PaulN2112CGE Dec 2, 2024
838e853
Add to clipboard
PaulN2112CGE Dec 2, 2024
89c09aa
Add matches_kind, get_frozen_properties
PaulN2112CGE Dec 2, 2024
f48186a
Improve usages, add Constrained Pattern
PaulN2112CGE Dec 2, 2024
2e3c8ad
Only check ';' if is_mutlip_placeholder
PaulN2112CGE Dec 2, 2024
1b5c710
strip surrounding whitespace
PaulN2112CGE Dec 2, 2024
786c6a7
publish ConstrainedPattern and CPPUtils
PaulN2112CGE Dec 2, 2024
3a88a0f
fullmatch ignore case
PaulN2112CGE Dec 2, 2024
7ed17a0
Improve useability after test
PaulN2112CGE Dec 2, 2024
260965d
Add CPPUtils
PaulN2112CGE Dec 2, 2024
8c8b52d
Move ComposeReplacement to test_ast_rewriter
PaulN2112CGE Dec 2, 2024
6a66619
check on references for using
PaulN2112CGE Dec 2, 2024
a7b8e88
add some utilities and ConstrainedPattern
PaulN2112CGE Dec 2, 2024
168c7b8
Insert a Type Ref node for built in types, add matches_kind
PaulN2112CGE Dec 2, 2024
98258ea
Remove magic behavior from ast_rewriter
PaulN2112CGE Dec 2, 2024
13c8f76
Add Testcase for nested refactorings
PaulN2112CGE Dec 2, 2024
2a11381
Remove user_object
PaulN2112CGE Dec 2, 2024
7f7d7d2
Remove print statements
PaulN2112CGE Dec 2, 2024
85d0e84
Add DeclLoc node
PaulN2112CGE Dec 2, 2024
d148b98
do not add inserted node to references
PaulN2112CGE Dec 2, 2024
4965595
remove print
PaulN2112CGE Dec 2, 2024
108d9d0
remove exception for CallExpr, improve reference resolving
PaulN2112CGE Dec 10, 2024
367c1b5
Fix compile errors
PaulN2112CGE Dec 10, 2024
3ea04a1
create a more complex recipe example
PaulN2112CGE Dec 10, 2024
d371da4
Split patterns
PaulN2112CGE Dec 10, 2024
ca59af4
Fix compiler errors, repeat until finished
PaulN2112CGE Dec 10, 2024
c783cab
Remove unused in_memory
PaulN2112CGE Dec 10, 2024
820c750
or_else may return anything
PaulN2112CGE Dec 10, 2024
d9d89ef
improve reference handling, store results in temp file
PaulN2112CGE Dec 10, 2024
a4d68fb
publish Recipe handling
PaulN2112CGE Dec 10, 2024
1860216
Improve kind match
PaulN2112CGE Dec 10, 2024
a3315f9
Support nested pattern matches
PaulN2112CGE Dec 10, 2024
bf84aae
Common refactor action (experimental)
PaulN2112CGE Dec 10, 2024
0314671
Fix offset handling, support Sequence of patterns
PaulN2112CGE Dec 10, 2024
e24a370
better guessing, add constructor_call
PaulN2112CGE Dec 10, 2024
a596601
better handling of *
PaulN2112CGE Dec 10, 2024
0e13e75
REmove {?i) add decl/def refs
PaulN2112CGE Dec 10, 2024
0090230
Fix compilation errors
PaulN2112CGE Dec 10, 2024
76b3baa
Change criteria for adding a TypeRef
PaulN2112CGE Dec 12, 2024
032a9f5
test more examples
PaulN2112CGE Dec 12, 2024
dad06e6
Small-fixes-in-clang_json_ast_node.py
PaulN2112CGE Dec 20, 2024
8c537ea
Filter-out-source-filename-when-present-as-command
PaulN2112CGE Dec 20, 2024
43f16ce
VERBOSE = False
PaulN2112CGE Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
get_names return Sequence
  • Loading branch information
PaulN2112CGE committed Nov 15, 2024
commit d3672a79fb321b8830813ece65ce58964e6a43a5
4 changes: 2 additions & 2 deletions python/src/syntax_tree/match_finder.py
Original file line number Diff line number Diff line change
@@ -139,8 +139,8 @@ def get_raw_signature(key:str, location: tuple[int,int]) -> str:
return {k:get_raw_signature(k,v) for k,v in self.get_locations().items()}

@cache
def get_names(self) -> dict[str, str]:
return {k:v[0].get_name() for k,v in self.get_nodes().items()}
def get_names(self) -> dict[str, list[str]]:
return {k:[vi.get_name() for vi in v] for k,v in self.get_nodes().items()}

@cache
def get_locations(self) -> dict[str, tuple[int,int]]: