3,047 questions
0 votes
2 answers
77 views
How to reliably map glibc dynamic symbols (e.g., open@glibc) to kernel syscalls (e.g., openat)?
I am trying to build a mapping between the dynamic symbols in ELF files (from glibc) and the actual kernel syscalls they invoke. My environment is x86_64 Ubuntu 22.04. What I've Tried Parsing man 2 ...
1 vote
0 answers
22 views
Conditionally create nodes using JAVACC and JJTREE
I am having difficulty figuring out the best way to conditionally create nodes using javacc and jjtree. In my grammar there are literals, variables, operators and functions. Variables can have the ...
1 vote
1 answer
87 views
How to represent a potentially infinite list of computation as an algebraic datatype
Let's say I want to define a potentially infinite list of computation as a data type. So that the computation could be fun a -> a' = Just a' || fun (a -> a') || fun (a -> b) &...
2 votes
0 answers
43 views
Get comments inside ast.CompositeLit node in golang.org/x/tools
I want to parse some ast.CompositeLit nodes and do some reordering of the fields instantiated in a struct. So, for example, imagine that I have the following struct: _ = Person{ // the name Name: &...
0 votes
0 answers
51 views
opa ast library unable to unmarshal my json ast
Iam trying to unMarshal AST json to ast.Module structure of OPA. policy.rego: package example.authz import rego.v1 allow if { some i input.users[i].role == "admin" } use command ...
2 votes
1 answer
92 views
How to resolve command name and parameters from a CommandAst
With writing custom PSSA rules and just parsing PowerShell scripts, I find myself often in the same use case where I would like to resolve command name (which is not that difficult) and the parameters ...
1 vote
1 answer
120 views
ast-grep `files` and `ignores` configuration not filtering properly in pattern detector
I'm using ast-grep to detect patterns in Java files, but the files and ignores filter configuration isn't working as expected. According to the documentation, we can apply pattern matching to specific ...
0 votes
0 answers
36 views
astor, ast, astunparse do not preserve lineno, astmonkey puts \ (backslash) everywhere
Here is the output run on a very simple urls.py from a test Django project: from django.contrib import admin from django.urls import path urlpatterns = [\ path('test_path1/', views.test_view1, ...