Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
72 views

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 ...
신경철's user avatar
1 vote
0 answers
18 views

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 ...
opeongo's user avatar
  • 474
1 vote
1 answer
87 views

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) &...
xiaolingxiao's user avatar
  • 4,937
2 votes
0 answers
43 views

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: &...
Manuelarte's user avatar
  • 1,904
0 votes
0 answers
50 views

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 ...
user27911082's user avatar
2 votes
1 answer
92 views

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 ...
iRon's user avatar
  • 24.4k
1 vote
1 answer
120 views

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 ...
bazzinga's user avatar
0 votes
0 answers
36 views

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, ...
Luna's Chalkboard's user avatar
0 votes
0 answers
96 views

I'm working with ast-grep and trying to modify Java code by adding a new method at the end of the class (not necessarily at end, it can be anywhere in class )and inserting a method call. Despite ...
bazzinga's user avatar
0 votes
0 answers
60 views

For my GameVM project I'm using ANTLR v4 to create multiple compiler frontends. Generating the lexer and parser for each language saved me a ton of work (especially since I have no background in ...
Kenneth Cochran's user avatar
0 votes
0 answers
21 views

I'm using @phenomnomnominal/tsquery and I seem to be having a really hard time with child selectors. Here is some demo code: import { tsquery, SyntaxKind } from '@phenomnomnominal/tsquery'; import { ...
Sam Redmond's user avatar
2 votes
1 answer
84 views

First time asking a question here, apologies if this isn't sufficiently clear :) I have a list of Foos, where Foo is some struct type imported upstream. Foo has some field Bar that is a bit ...
dogs's user avatar
  • 43
0 votes
0 answers
35 views

I have been able to use Google's errorprone on Java code along with other an extension-checker (Uber's NullAway) which catches potential errors at build time. From what I've seen searching around, it ...
Don's user avatar
  • 1,241
0 votes
1 answer
84 views

I am doing something like let p = `(function (X) { var q = 0; for (; q < 5; ) { // do some stuff anotherfunc = function (a) { while (X === "somestring") { X += &...
younes zeboudj's user avatar
0 votes
0 answers
28 views

I want to resolve type using typescript library. I want the type to be displayed as type typeCheck = { name: string } I am not able to find the exact typeChecker function that typescript library ...
Bippan Kumar's user avatar
0 votes
0 answers
113 views

I'd like to use Pydantic to define and validate AST of queries that will be applied on a Pandas dataframe. Here's my code: from typing import List, Literal, Optional, Union from pydantic import ...
Gino's user avatar
  • 913
0 votes
0 answers
210 views

So I have a project I'm working on and it will require an LLM to update existing code and write it back to the editor,where I'm having issues is finding a good way to update anywhere within the code ...
Precious112's user avatar
0 votes
1 answer
55 views

I'm working on an SQL query dialect converter. For example, given a MySQL query, it can convert it to Postgres or BigQuery. It was easy to find MySQL, SQLite, and part of the PostgreSQL grammar file, ...
Miki Maine's user avatar
1 vote
1 answer
78 views

Target code block: int age = 5; std::stringstream q; q << "my name " << "is Tom, " << "my age is " << age; I'm trying to create a matcher to ...
LunaticJape's user avatar
  • 1,604
1 vote
0 answers
45 views

I'm trying to build my first clang AST tool on windows 10. I want develop on visual studio code in c++ - I can live with any compiler that works... I've looked at the clang documentation , YouTube ...
Yonatan.Lehman's user avatar
2 votes
2 answers
65 views

I'm currently working with Clang's ASTMatcher to extract struct declarations and exclude tagless structs. Here's an example of the kind of struct I want to avoid matching: #include <stdlib.h> ...
cardigan's user avatar
1 vote
0 answers
38 views

Example code: #include <string> class DBFetcher { public: void findByName(std::string name) {} void findByNameV2(std::string name) {} } DBFetcher getFetcher() { return FBFetcher(); ...
LunaticJape's user avatar
  • 1,604
0 votes
1 answer
131 views

I want to create a transformer that converts all quotes of f-strings from a single quote to triple quotes, but leaves nested f-strings intact. For example, the next expression left intact. f"&...
Maxim Kirilov's user avatar
3 votes
1 answer
72 views

How can I convert Python object - a list, into an ast.List object, so I can appent it to the main AST tree as a node huge_list [ 1, "ABC", 4.5 ] object = ast.Assign([ast.Name(...
user avatar
2 votes
1 answer
124 views

I'm working on a project where I'm using Bison to generate a parser and Flex to generate a lexer. My parser is meant to generate an Abstract Syntax Tree (AST), and I've defined the ASTNode structure ...
JustAGirl's user avatar

1
2 3 4 5
61