Click here to Skip to main content
15,891,431 members
Everything / Compiler

Compiler

compiler

Great Reads

by Chris Boss
More about BASIC and what can be accomplished with the language
by honey the codewitch
An LL(1) pull parser and generator that thinks it's an LL(k) parser - with a rich, simple and beautiful EBNF syntax
by Dennis C. Dietrich
Clarifying how the .NET GC identifies objects to collect once and for all... hopefully...
by honey the codewitch
If you use the CodeDOM, here's an indispensable package to make it awesome.

Latest Articles

by Tamar Christina
The article discusses various techniques for improving program performance by optimizing code for compilers, focusing on the ARM platform.
by Alex Rakov, Alexandre Bencz
ELENA is a general-purpose, object-oriented, polymorphic language with late binding
by AmrDeveloper
Introduce GQL (A Git Query Language) to perform SQL like queries on .git files
by Coral Kashri
How compiler helps code run faster and generates warnings in single cross-compiler way

All Articles

Sort by Updated

Compiler 

N 30 Apr 2024 by Tamar Christina
The article discusses various techniques for improving program performance by optimizing code for compilers, focusing on the ARM platform.
20 Feb 2024 by Alex Rakov, Alexandre Bencz
ELENA is a general-purpose, object-oriented, polymorphic language with late binding
28 Jul 2023 by AmrDeveloper
Introduce GQL (A Git Query Language) to perform SQL like queries on .git files
22 Apr 2023 by Coral Kashri
How compiler helps code run faster and generates warnings in single cross-compiler way
15 Apr 2023 by DavesApps
A way to catch / prevent race conditions in multithreaded code
9 Apr 2023 by Sai nathi
Hi I'm trying to run some c++ code on my mac but i'm getting an error: **clang: error: linker command failed with exit code 1** I'm trying to execute multiple .cpp files from vs code but it keeps showing the error. I think its something to do...
9 Apr 2023 by k5054
You probably have a directory (or folder if you prefer) in your current directory called M123 change the destination name to something else, or rename the directory/folder. e.g. : [k5054@localhost]$ ls hello.cpp [k5054@localhost]$ mkdir hello...
19 Nov 2022 by Moneer Fahmy
I guess, they are using Application Programming Interfaces(APIs). So, they are sending the user coding into URL of API to compile it. If you have any question let me know Online Python Compiler
15 Nov 2022 by Chris Boss
More about BASIC and what can be accomplished with the language
2 Nov 2022 by montasser20
To do that you have to own VPS to run shell commands the following example shows you how to run a python file in shell. That means you will receive the input then create a virtual file with python name and then execute it by using the following...
2 Nov 2022 by hermione88
Hello everyone, I need to create a web page that can take the input from the user and compile it according to the selected programming language. Please, could you help me ? What I have tried: I saw many sites providing services to compiling...
9 Apr 2022 by Hoang Minh Quang FX15045
I'm learning about the time complexity of algorithms. As far as I know, the compile-time will take longer the larger the input (larger in this situation means more input). But I wonder, is the input number itself matter? For example, I have a...
9 Apr 2022 by Patrice T
Quote: As far as I know, the compile-time will take longer the larger the input (larger in this situation means more input). Compile time is no linked with larger input, but runtime is linked to size of input. Quote: But I wonder, is the input...
9 Apr 2022 by OriginalGriff
Quote: I'm learning about the time complexity of algorithms. As far as I know, the compile-time will take longer the larger the input (larger in this situation means more input). But I wonder, is the input number itself matter? No. Compilation...
9 Apr 2022 by Richard MacCutchan
If the numbers are constant values in your source code then compile time may be a few attoseconds longer. If they are input to the program at run time then compile time will not be affected.
13 Jan 2022 by Pepe Sea
So we all know how Python is a generally simple, and easy-to-understand language both in syntax and logic. Now I'm thinking of a project in which I would need a slightly modified version of Python with little logic, and syntax tweaks. So I...
13 Jan 2022 by Afzaal Ahmad Zeeshan
This kind of question can easily be answered with a quick Google search. But, I would like to ask you why you want to do it? Python is an open-source programming language and is actively contributed to. If you wish to contribute, visit Python...
13 Jan 2022 by BillWoodruff
I thought using 'pragma for suppression was weird enough ... until I ran across ... I have a function that returns a Tuple in the form of: (IEnumerable, IEnumerable): there are two cases where a null result may terminate...
13 Jan 2022 by Richard Deeming
This is part of the (relatively-new) "nullable reference types" feature: Nullable reference types | Microsoft Docs[^] When enabled, the compiler assumes that any reference type must not contain null unless it is marked as "nullable" by appending...
10 Dec 2021 by rudy-peto
#includeint main(){ printf("ABCDEFGHIJKLMNOPQRSTUVWXYZ");}i tried to compile above C++ code under windows using g++ -S test1.cpp -o test1.o to get the assembly. but it didn't look like an assembly like i used to use in emu8086. it looked like...
9 Dec 2021 by Dragos Ginjoveanu
I am looking for a c++ compiler that I can integrate into a page from my website. It means that a user could write and compile c++ code on the website. What I have tried: Until now, I've found that I can do this using...
9 Dec 2021 by Dave Kreskowiak
You can use just about any C compiler you want. I haven't seen one yet that isn't command-line driven. Like 'Griff said, you better be DAMN careful about how you compile code from an untrusted user and even more careful about the account you use...
9 Dec 2021 by OriginalGriff
The GDB compiler / debugger works, as is shown on their online compiler site: Online C Compiler - online editor[^] - and it works for loads of languages! Be aware though that you are running one heck of a risk if you aren't careful: part of the...
29 Oct 2021 by deXo-fan
Hello, I've noticed that whenever you write a program in Visual Studio that uses structs (or classes), the assembly code generated doesn't contain a single MASM STRUCTURE, even though it would perfectly fine. Instead, VC++ does something I...
28 Oct 2021 by Pete O'Hanlon
More in-depth look at classes, how to add our own constructors and change whether or not code outside our class can see our fields
26 Oct 2021 by den2k88
Assembly does not have structs. MASM does but it is its own interpretation of Assembly. Indeed the name itself means Macro ASseMbler and STRUCT is one of these macros, provided to help the developers. This kind of additional keywords is normal...
25 Oct 2021 by Pete O'Hanlon
Getting started with TypeScript
17 Oct 2021 by TomLeywin
After reading https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ despite the document listing a list of Reserved keywords and a list of Contextual keywords, as well stating how any new keyword added to the C# language...
17 Oct 2021 by BillWoodruff
I like to think of reserved words as sacred cows, and contextual keywords as ordinary livestock :) imho, all cows should be sacred (no reference to Hinduism intended). Isn't the idea of unique names (without multiple meanings in different...
16 Oct 2021 by OriginalGriff
Quote: Is that really the only difference between a Reserved keyword and a Contextual keyword in C#? Yes. Basically, it's a legacy thing: the reserved keywords are the original language keywords, and cannot be used as identifier just as they...
22 Aug 2021 by RegularJoe5150
An alternative solution to a standard macro that aims to make macros, just a little bit less evil
6 Jul 2021 by col bur (solder fumes.cs)
here is the file that it is getting all the errorshttps://github.com/openbeast90/delude/blob/master/delude-logger/Resources/Webhook.cs if you have any questions about the project ask so i can help you help me or just look through the rest of the...
5 Jul 2021 by OriginalGriff
Look at your error messages: they are very clear. YOu code is attempting to declare classes that already exist. The namespace "Stealer" has two classes called "FormUpload" and so forth - you can't have that. Either one set must be in a different...
26 May 2021 by Patrick P. Frey
In this article we see how a very primitive compiler is written in Lua using Mewa and how to compile and run a simple demo program in the shell.
15 May 2021 by Ahmad Qassym
what does the statement int x[10] = {0}; mean ? what confuses me is that the arry is in size of 10 ,it means it must contain 10 elements ..but why we can set it to only one element {0} without to get an error ? the language is c! What I...
15 May 2021 by KarstenK
This convenience syntax has become part of the C language reference in the C 99 standard to speed up development.
15 May 2021 by k5054
When initializing arrays in 'C', we do not need to specify all the elements in the array if we want them to be zero. By using int x[10] = { 0 } we can be assured that all 10 elements of the array are zero, without having to type out each one. ...
29 Apr 2021 by OriginalGriff
Wrong website: this is for software development, not maths homework.
24 Apr 2021 by Ahmad Qassym
1) gcc -c file.c -o file.o 2) gcc file.c -o file please if u gonna to answer the question ,try to give an simple answer as much as possible! What I have tried: ......................................................
24 Apr 2021 by Aghast (nj)
Command (1) compiles the .c file to a .o (object) file, then stops. Command (2) compiles the .c file to an object file, then links the object file with the C standard library to produce an executable file named file. Both commands drop their...
24 Apr 2021 by Dave Kreskowiak
-c Compile or assemble the source files, but do not link. The linking stage simply is not done. The ultimate output is in the form of an object file for each source file. By default, the object file name for a source file is made by replacing...
31 Oct 2020 by WebDevLite
I’m doing frontend mentor challenges using sass and wanna create page with this projects. Folder structure is like this Main-folder Project 1 Project 2 Project 3 ... Dist Sass index.html Each project folder has...
17 Oct 2020 by Khalfan 10679609
I fixed mine on a project that compile without any problem but after a crash out of nowhere cropped up this same error. I fixed it by defining _AMD64_ in the Preprocessor definitions
17 Oct 2020 by Indrajit kumar
Hi,I am getting error of "No Target architecture defined" in driver entry. i am trying to write driver entry for wireless miniport in vc++ and wdk on vista plateform. But this error fed up me. so pls help me out.1>------ Rebuild All started: Project: DriverMiniport, Configuration:...
7 Sep 2020 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
30 May 2020 by lord_raven_lee
I am having trouble, understanding how the parser is using the current_token, to start testing the grammar. I don't know if I am using the current_token right in parse and match, and if it's just that i am not having it print right. Or if its not...
30 May 2020 by KarstenK
Best is to use the strtok of th C library after reading the documentation. It needs some starting token and than returns following founds.
19 Jan 2020 by honey the codewitch
A completely programmable lexer/tokenizer/scanner generator in C# using a Pike Virtual Machine
17 Jan 2020 by honey the codewitch
A Pike VM for running non-backtracking NFA regular expressions in C#
9 Jan 2020 by honey the codewitch
Generate powerful, maintainable parsers in most major .NET languages using a friendly grammar format
6 Jan 2020 by honey the codewitch
Using Parsley to parse a C# subset into the CodeDOM
15 Dec 2019 by honey the codewitch
Code generation, faster
11 Dec 2019 by honey the codewitch
If you use the CodeDOM, here's an indispensable package to make it awesome.
7 Dec 2019 by honey the codewitch
Getting an accurate CodeDOM back from a C# source subset
5 Nov 2019 by Stefan_Lang
I strongly suspect this is a bug in the compiler's code optimization: M isn't read by the program, so the compiler will try to eliminate code referring to it - maybe it messed up this optimization because the statement cin>>N>>M internally translates into a nested function call:...
5 Nov 2019 by Shubham Avasthi
I was working on a C++ code, which for some unknown reason, does not terminate by Ctrl + C. The below code is a reduced version of the code I was working on and it has the same issue. Moreover, if I don't take an input for M (remove '>>M') or remove vector a(n) or initialize the size of vector...
5 Nov 2019 by RickZeeland
Might be a debugger issue, see: Workaround for GDB Ctrl-C Interrupt | MinGW[^]
5 Nov 2019 by CPallini
On my Linux box (Ubuntu 18), the following program #include #include using namespace std; int main() { int N,M; cin>>N>>M; vector a(N); } compiled with the g++ -O3 -std=c++14 (g++ 7.4.0) behaves as espected.
20 Oct 2019 by Lymisy
#define _CRT_SECURE_NO_WARNINGS #include #include #include "type.h" FILE *file; char buffer[1000 + 1]; // + 1 for the null terminator. char tokens[1000 + 1]; int index = 0; int line_num = 0; int line_row = 0; int line_column = 0; int max_token = 0; void show_table();...
20 Oct 2019 by KarstenK
Your data variables are fix memory and when you want to change it, you must alloc some (bigger) memory than memcopy the original data and than add the data at the correct locations. The same is also possible with the enum, but you need some buffer too. So work with some dynamic int array.
19 Oct 2019 by Richard MacCutchan
if (IDENT) { show_table(); } This will always be true since IDENT is a non-zero value. It should be if (token == IDENT) { show_table(); }
29 Sep 2019 by Member 14607367
I am to prog some code on C++ which should calculate a fibonacci number in compiler time. So it should look like this: int main() { int v=???6???; } The six is the number of the fibonacci number 8. And the question marks are some symbols which should be added to calculate the fibonacci...
29 Sep 2019 by Richard MacCutchan
See fibonacci sequence - Google Search[^]
29 Sep 2019 by Greg Utas
Hint: use a template whose template parameter is an int. Stronger hint: search online for the same solution for a factorial and adapt it.
20 Aug 2019 by honey the codewitch
Using PCK to create grammars, parsers and tokenizers for C# and other .NET languages
17 Aug 2019 by honey the codewitch
Using PCK's grammar system, and understanding the concepts behind it
14 Aug 2019 by Advik Raj
so, I have this asm code with me and i wish to use it inline with c++, (a combo of asm and cpp) i have seen many links for this but none answer how to do this, the asm code is below .text .def ___main; .scl 2; .type 32; .endef .section .rdata,"dr" LC0:
14 Aug 2019 by Rick York
We can't always get what we want. Here are three links to articles that show you how to write inline assembly. The first link is to an article at this site. https://www.codeproject.com/articles/15971/using-inline-assembly-in-c-c ...
14 Aug 2019 by honey the codewitch
An LALR(1) parsing algorithm as part of Pck
13 Aug 2019 by Richard MacCutchan
This is the third time you have asked this and we have already given you some pointers. Firstly assembly code cannot be directly converted to C++ code, there is no correlation between the two. And secondly if you want to learn C++ properly then get a book or search online for tutorials. And if...
13 Aug 2019 by OriginalGriff
Quote: pls write down the code for me. It doesn't quite work like that. We do not do your work for you. If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there. But be aware: you get what you pay for. Pay peanuts, get monkeys. The idea of...
13 Aug 2019 by CPallini
Quote: I have converted C code into Assembly code using MinGW (GDB) in CMD. Nope, you didn't convert it. The gcc compiler compiled it to assembly. In any case, while converting a piece of code from a programming language to another, you should know well both of them, in order to fully understand...
13 Aug 2019 by Advik Raj
According to my logic, I think it is possible to convert one language to another, without a transpiler. C code: #include int main(){ printf("Hello, world!"); return 0; } 1. I have converted C code into Assembly code using MinGW (GDB) in CMD. This C program is a simple Hello-World...
13 Aug 2019 by Patrice T
Quote: but i could not seem to find the syntax. i tried but i always get an error. Advice: Never do this, not like that! The code in your comment show that you do not understand what you do, and it is a good thing that you get errors. This piece of code: 0x00401410 : push %ebp...
13 Aug 2019 by Maciej Los
Check this: Using Inline Assembly in C/C++[^]
6 Aug 2019 by Salvatore Allegra
I think my question may best be explained by some examples... Example 1: I open up the developer tools in chrome and select the console. I wonder how in the world the developers of chrome are showing compiler/interpreter output in the console window, or something as simple as console.log...
6 Aug 2019 by Richard MacCutchan
Buy books, find sources on the internet, and practice, practice, practice.
6 Aug 2019 by honey the codewitch
A parser generator and unification system for different parsing tools
25 May 2019 by zequion
Cuestion 1.- In VS 2017 I have a class called "Common" that includes various useful functions to the rest of the classes. If I extract one of the functions and include it in a new class, when I try to compile the class "Common" it tells me that the class that I have extracted does not exist....
25 May 2019 by OriginalGriff
Question 1: That's going to depend on where these classes are: if you are moving between projects then yes, you will need to compile projects before the revised assembly can be used in a different one. Think about it: if you are writing code for two assemblies at the same time, you don't want...
14 May 2019 by honey the codewitch
An LL(1) pull parser and generator that thinks it's an LL(k) parser - with a rich, simple and beautiful EBNF syntax
9 Mar 2019 by AlexeyYakovlev
This paper demonstrates a technique of building Sprache parsers using grammar inheritance.
22 Sep 2018 by User 13961703
ok, so I'm a bit rusty at coding and have no experience debugging what so ever. and would really like some help fixing the errors in the title. which are } expected(CS 1513) and ; expected(CS 1002) I'll post the code below.(this is taken from a video lecture done by my professor.) if it is a...
22 Sep 2018 by OriginalGriff
Since there are only 37 lines in that code, it doesn't help anyone to say "it's line 49" ... But ... look at your code. I'm guessing it's this line: ResultsListBoxMM.Items.Add(i + 2).ToString() + "" + percentMM.ToString()); Where brackets don't match up. What is that final ')' doing...
20 Aug 2018 by NewPast
Software protection & Decompiling software as a new cracking method
1 Aug 2018 by RavenLee
I understand tokenizing. I can get the lex to read the file, split the tokens, and display it in the console. What is the process after this? How do I retrieve the tokenized information or pass it to the parser, and connect with the treenode? The code I have prints the whole buffer that is read,...
29 Jul 2018 by Patrice T
The name for those programs is 'compiler'. Writing a compiler is not for beginners, it is advanced topic. if you want to learn about compilers, I recommend the dragon book: Dragon Book - Wikipedia[^] Compilers: Principles, Techniques, and Tools - Wikipedia[^]
29 Jun 2018 by KarstenK
You can use the function strtok for parsing in C.
20 Apr 2018 by mgoblue0970
@Richard MacCutchan, thanks for the reply! I'm really confused by a couple of things though... Quote: Because (I think) BasicTest is (implied to be) in package com.myCompany It's not implied to be. It is! Both source files start with: package com.myCompany; Quote: Try the following, with...
20 Apr 2018 by mgoblue0970
Here's the folder structure: C:. └───src ├───main │ └───java │ └───com │ └───myCompany │ └───Runner.java │ └───test └───java └───com └───myCompany └───BasicTest.java Here's...
20 Apr 2018 by Richard MacCutchan
I have been playing around with this, and reading Setting the class path[^], and managed to get a set built, although not the complete directory tree that you have. Try the following, with the reduced classpath tree: javac -cp c:\workspace\BasicTest\src\test\java...
3 Mar 2018 by Filippo Fantinato
Hi, i'm developing a compiler and i'm having some problems building the abstract syntax tree and using it for the intermediate code generator. Does anyone have some references or some advices which could help me? This is the repository of the compiler that I'm writing with my friends...
7 Jan 2018 by kkdxghlctlcxxtidyuum
Hello, Just a general question: A made-up programming language that is then interpreted/compiled(?) using a high-level programming language such as C++ to give output is what: a compiler or an interpreter E.g. MoveCursor(132, 242 (Spline)) - made up programming language example. This...
7 Jan 2018 by Thomas Daniels
Quote: My question is: Is this made up language a source-to-source compiler, or is it an interpreter? Neither. It's a programming language. A compiler is a program that transforms code from one language to another (for example, C to Assembler). An interpreter is a program that performs...
25 Nov 2017 by abdou_31
How can i write a program using C# and visual studio 2017 that compile a code source writing on C programming, How can i do that? any simple solution to write this program? if not , so how can i use flex and bison for that program ? If C# didn't do this job, what is the perfect language that i...
25 Nov 2017 by CPallini
Building a C compiler from scratch, altough feasible, is rather complex. Tools like flex and bison would actually simplify the task. However, they are C/C++ oriented. You might have a look at ANTLR[^].
25 Nov 2017 by Dave Kreskowiak
Have you tried Googling for "How to write a C compiler[^]"? This is not a trivial task. There is nothing simple about it. Now, if you were looking to just compile C code, you could always just launch the CL.exe command line compiler. I have no idea what the intent of this project is so it's...
28 Aug 2017 by Alexey Shtykov
A few words about function templates