Skip to main content
1 vote
0 answers
26 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 ...
2 votes
0 answers
145 views

I am working with a situation in which I need to turn an arithmetic string expression (e.g. (3/2) * (3**4 / (20 * 4))**(-1/4)) into the following prime factorization form: $\prod_{p:\text{prime}}p_i^{...
2 votes
0 answers
44 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: &...
0 votes
0 answers
61 views

I have a simple Angular app: import { Component } from '@angular/core'; import { bootstrapApplication } from '@angular/platform-browser'; @Component({ selector: 'app-root', template: ` <...
0 votes
0 answers
54 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 ...
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, ...
0 votes
0 answers
100 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 ...
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 ...
0 votes
0 answers
25 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 { ...
1 vote
0 answers
50 views

Issue with Parent Condition Context in Else Block During AST Traversal I’m working on a JavaScript code analysis tool that traverses the Abstract Syntax Tree (AST) to analyze function calls and their ...
0 votes
0 answers
41 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 ...
0 votes
0 answers
25 views

I want to use AST transformation using jscodeshift to do a large scale refactor, changing our test runner from Jest to Bun Test. A concern that I'm trying to mitigate is that we might migrate the ...
0 votes
0 answers
71 views

I want to analyze the code structure of a nested kdb+ queries just like what python ast module does to the python codes. I know that kdb "parse" function already does this in kdb, but how I ...
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 ...
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 ...

15 30 50 per page
1
2 3 4 5
38