3,913 questions
0
votes
1
answer
54
views
Which scope does the {$I-} directive have in Pascal?
I disable I/O checking inside a procedure:
procedure RewriteText(
FileName: string;
var TextFile: text;
var ErrMsg: string
);
begin
{$I-}
assign(TextFile, FileName);
rewrite(...
1
vote
1
answer
127
views
How can we make CMake generate a .cpp file and compile a library at every build?
In our project (C++ + CMake), we are trying to embed into a log line the project build timestamp. We thought of using a CMake custom command, and we managed to make it regenerate a .cpp file at every ...
0
votes
2
answers
73
views
jaxb2 inheritance plugin does not extend a class in /src/test/java
I'm on a java/maven project, using the jaxb2 inheritance plugin in order to define parent classes for xjc-generated java classes.
I'm having this xsd:
<?xml version="1.0" encoding="...
0
votes
1
answer
65
views
How to Fix swagger_dart_code_generator Generating List<int> Instead of MultipartFile for File Uploads in Flutter
What are the details of your problem?
In my Flutter project, I'm using swagger_dart_code_generator to generate Chopper-based API client code from a Swagger 2.0 JSON file for a multipart/form-data file ...
1
vote
1
answer
120
views
How is rust able to optimize Option::is_some_and so effectively? [closed]
Looking at the codegen of a check inside for-loop I wanted to see if there is an optimization opportunity by outlining is_some_and but both cases had the same codegen.
struct V {
len: Option<...
1
vote
0
answers
56
views
How can I manage duplicate shared schema declarations from an OpenAPI spec for shared libraries?
I have a series of OpenAPI 3.0.3 specifications for multiple ASP.NET services. The schemas for the services use a series of shared models: in this case, common error responses, types for dates/times, ...
3
votes
1
answer
224
views
How can I iterate over struct fields at compile time in Zig to generate a serializer?
I'm learning Zig and I'm trying to write a generic function that automatically serializes any struct into JSON. In languages like Rust or Go, there are libraries that can iterate over the fields of a ...
-2
votes
1
answer
102
views
Expression compiler for .NET [closed]
We have a system with many logic expressions, they're implemented as series of boolean functions operating on variables and the rules are stored as XML. As the XML files are compiled into the assembly ...
0
votes
0
answers
103
views
Annotation based code generation fails compilation before code is generated
I am writing a Java library in which I'm attempting to auto-generate some boilerplate code using annotations. The generated code is a large hierarchy of sealed interfaces with lots of cyclic ...
1
vote
0
answers
56
views
Why does jOOQ multiset fail with SQLite when using row(...) and multiset(...) inside findAll()?
I'm using jOOQ (version 3.20.2) with SQLite, and I'm trying to fetch a record along with a multiset of related entries. I know that jOOQ emulates MULTISET via JSON in SQLite, but I get a runtime ...
0
votes
0
answers
124
views
sea-orm cli does not find postgres schema and generates an empty entity file
I'm working in an application that's currently switching from surrealdb to regular postgres using the sea-orm crate, but the cli is failing to find anything. I'm not sure what I'm doing wrong, as I'm ...
0
votes
0
answers
142
views
Why doesn't my incremental C# code generator run?
I am writing a code generator to add functions to existing interfaces and that sort of thing. But I can't even get the project to launch.
To be clear, it builds, compiles, goes through all the motions,...
1
vote
1
answer
40
views
.Net 9 codegen in Rider adding --sqllte flag by default. Any fixes?
I'm doing some .Net apps on mac, using Rider. Regardless if the whole project is scaffolded with VS Code or Rider itself, anytime when I hit Add Controller it the code generator with --sqlite flag ...
0
votes
0
answers
37
views
CodeGen for ARM cortex-A: How to update GCC v12 toolchain
I am using Matlab codeGen to create a C++ lib for my ARM cortex-A env.
and using an Add-On named "Embedded Coder Support Package for ARM Cortex-A Processors", which included the full package,...
-4
votes
1
answer
88
views
Syntax-aware deletion of code blocks in a lua file [closed]
I created a bash script that automatically populates a lua config file with ssh-mux settings according to my input. The populated config file looks like this:
ssh_domains.lua
local M = {}
M....
1
vote
0
answers
70
views
Avoid AdditionalFiles item being compiled as C#
Im trying to create a code generator using Roslyn, it specifies the generator must not access IO methods and reach physical files. Instead, files should marked using AdditionalFiles build action (item ...
4
votes
1
answer
91
views
How to call a SymForce auto-generated function with a user defined type?
Suppose I have a Python function Foo() that I'm auto-generating to C++ with SymForce's codegen functionality. It's a complicated function with a lot of parameters, so I want to pass in a Params struct ...
1
vote
1
answer
67
views
Source Generator has empty list of Pre-Processor Symbol Names
I am writing an incremental C# source generator which I would like to use in .NET (net9.0) and Unity (6.0) projects. The generator should have slightly different behaviour in each (generate Task in ....
0
votes
1
answer
83
views
Generating, compiling and executing JUnit on the fly
I have a class that generates Restassured JUnit tests in a specific subfolder of my build/tests/ structure, based on some postman test collections.
I have written a test to take all the *....
0
votes
1
answer
139
views
How to run Chromium browser with the following args --disable-web-security --user-data-dir=”...”
I want when executing the following command:
playwright codegen demo.playwright.dev/todomvc
I open the browser with the arguments of --disable-web-security --user-data-dir=“...”.
Can this be done? I ...
0
votes
1
answer
64
views
How can I pass variables to a procedurally generated global function in Lua?
I was recently trying to write event callback handlers for my UI system, and I've been having trouble accessing higher-scope variables from a procedurally generated global function.
Here's some sample ...
0
votes
0
answers
20
views
Missing "Unrecognized UserBlocks Section" after migration to Cfg6
After migrating the generator code with gendevkit-generator-migrator-1.3.0 and generate gen data with Cfg6, there are missing code parts in the "Unrecognized UserBlocks Section". They were ...
0
votes
1
answer
54
views
How to write an XJC plugin that replaces JClass implementations for types
I have an xsd with some very large enums - if I allow XJC to generate actual Java enums for these types, I run into the problem described here:
Does an Enum Class containing 2000+1 Enum Constants hit ...
1
vote
0
answers
45
views
How to use ast to parse javascript code and find out the execution conditions of specified methods
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
79
views
404 during introspection in graphql with dynamic code generation
Im trying to build a graphql schema during runtime without any static schema definitions. I have the following classes
@Component
public class GraphQLProvider {
private GraphQL graphQL;
...
2
votes
0
answers
85
views
sympy codegen for MatrixSymbol resp. sum of arbitrary number of elements
I tried to generate C code for matrices of arbitrary size using sympy, but the code is invalid. Root cause seems to be that sympy's 'Sum' function is not properly translated.
Here is an example:
from ...
2
votes
0
answers
111
views
Roslynator fail with C# source generator
I have a project specific roslyn source generator. It is a project reference in a library (which is also a project reference) in my application.
<ProjectReference Include="$(RepoRoot)\...
1
vote
1
answer
30
views
How to generate one folder per model under the same source root with Telosys?
I'm trying to migrate a homegrown template engine to Telosys, but an important feature that I miss in Telosys is the ability to organize entity classes in subpackages under the same project (main ...
3
votes
2
answers
137
views
Template for creating methods in Visual Studio in C#
When creating a new method in a class in Visual Studio, the IDE generates the method as internal, but I want public to be the default.
I didn't find a way to change this behavior. I know that there ...
1
vote
1
answer
539
views
React Native (new architecture) sending events
I'm trying to add to my Turbo Native Module (both Android and iOS) an event listener, I'm following the documentation for RN 0.76 and so far I got the specification, native module that exposes events ...
0
votes
1
answer
73
views
How can I programmatically generate the list of canonical Postgresql keywords? [duplicate]
How can I obtain the list of Postgres keywords? Failing a programmatic solution, where can I look inside the Postgres project to get this list?
Context: for use in a code generation tool.
-1
votes
1
answer
105
views
graphql codegen typescript suddenly brokes and don't want generate types
GraphQL code generator ceased functioning correctly anymore. It no longer generates the expected code and has also deleted all previously generated files.
codegen.ts and package.json was not changed.
...
5
votes
0
answers
2k
views
Codegen enums trigger error "Typescript enum is not supported in strip-only mode" after updating node from 23.5.0 to 23.6.0
After upgrading from node 23.5.0 to 23.6.0, our Playwright test suites stopped working. It looks like it's related to an "--experimental-strip-types" setting.
We've fixed our code by ...
0
votes
0
answers
42
views
Compile and test classes generated by Maven template engine project
My Maven project is a template engine that generates some java classes from user input data (provided as a json file). It is simply composed of a top level module (myproject-parent, type pom) and a ...
0
votes
0
answers
98
views
How to access "Content" files in incremental source generator?
I'm trying to build an incremental source generator that will output nested classes with strings for each content file in my project containing its file path like so:
public static class Content
{
...
3
votes
0
answers
75
views
Unable to generate REST interfaces in Go for OpenAPI v3 using oapi-codegen
Is there a way to use tags (or another method) to generate interfaces in Go using oapi-codegen? I've tried:
paths:
/foobar:
post:
tags:
- FooInterface
operationId: createFoo
...
1
vote
0
answers
33
views
I can't figure out the correct behavior of the macro
At the moment (Dart 3.6.0) creates a macro file with the following content:
part of 'path_to_parent_file.dart';
// Generated code
Which means it is part of the parent file.
Everything works fine in ...
1
vote
0
answers
148
views
Jhipsters jdl does not generate entities
The following jdl:
entity Customer {
firstName String required,
lastName String required,
email String required,
phone String,
status CustomerStatus required,
company String,
jobTitle ...
0
votes
0
answers
93
views
RTW Embedded coder generating #includes in C file instead of H file
Environment:
Matlab R2022b
Simulink model
Problem:
I was generating code from Embedded coder and generated codes have header file declaration present in the C file instead of H file. I used the same ...
-1
votes
2
answers
159
views
How to add semantic analysis and code generation to a table-driven LL(1) parser?
I’ve implemented a stack-based LL(1) parser driven by a parsing table and symbol table. The parser processes tokens iteratively, using a stack to manage grammar symbols. Here’s a simplified version of ...
1
vote
1
answer
77
views
Is there a programmatic way to generate s-functions directly out of Simulink blocks
I would require wrapping the logic of my Simulink model to be obfuscated or hidden. One of the ways to perform it is to create a similar s-function block with the object code generated from the same ...
-1
votes
1
answer
441
views
Generate C# code model for DataVerse entities
I would like to generate some code so i can interact with DataVerse tables from C#.
I have played around with the PAC CLI Modelbuilder and used that successfully. My issue is, that i am in a corporate ...
1
vote
0
answers
132
views
How can I check scopes in oapi-codegen middleware?
I'm completely new to oapi-codegen and its generated code.
I tried to generate echo, as well as chi-server code.
I defined, in my openapi specification security like this:
/itworks:
get:
...
2
votes
0
answers
111
views
Using [MemberNotNull] in a virtual override that is called in BaseClass constructor
I have the following code Try it here
using System;
using System.Diagnostics.CodeAnalysis;
public class Base{
protected Base(){
Initialize();
}
protected virtual void ...
0
votes
1
answer
132
views
Multiple build actions per file in Visual Studio
I have a few C# (*.cs) files in my project that need to be included in compilation as well as distributed as source code along with the application (the application itself is not open-source).
...
0
votes
0
answers
69
views
deploying from Matlab to ARM breaks because of '\'
I run Matlab under Windows. I am new to this so hopefully this is dead simple problem. I try to deploy a model to arm-based device by pressing [Build Deploy Start] And I get this message:
Backslash '\...
2
votes
0
answers
181
views
Mason Bricks dynamic views with directories from args with loop
I am using Mason Bricks.
I know, you can also have loop in files. But is there also a way to use loops to create files from given args?
This is the structure I would like to accomplish:
...
0
votes
1
answer
181
views
Disable SIMULINK Code Generation or call MATLAB functions with functions/Variables not supported by code generation
I have a complex MATLAB model consisting of several subfunctions that I need to integrate into a SIMULINK model. However, the MATLAB model uses tables and a lot of functions and operations which are ...
1
vote
1
answer
542
views
Access to R.swift library resources generated inside the swift package from an Xcode project
My task is to bring R.swift into our own SPM, so that the code of app itself still has access to the generated Rswift resources.
Our package setup looks like this
let package = Package(
name: &...
2
votes
1
answer
718
views
How do I get started with traversing Clang's AST?
I am playing around with LLVM's frontend and would appreciate some help with general processing technqiues of the AST. In the CodeGen directory, I have a method that processes an instance of the ...