C Programming
made by https://0x3d.site
GitHub - orangeduck/mpc: A Parser Combinator library for CA Parser Combinator library for C. Contribute to orangeduck/mpc development by creating an account on GitHub.
Visit Site
GitHub - orangeduck/mpc: A Parser Combinator library for C
Micro Parser Combinators
Version 0.9.0
About
mpc is a lightweight and powerful Parser Combinator library for C.
Using mpc might be of interest to you if you are...
- Building a new programming language
- Building a new data format
- Parsing an existing programming language
- Parsing an existing data format
- Embedding a Domain Specific Language
- Implementing Greenspun's Tenth Rule
Features
- Type-Generic
- Predictive, Recursive Descent
- Easy to Integrate (One Source File in ANSI C)
- Automatic Error Message Generation
- Regular Expression Parser Generator
- Language/Grammar Parser Generator
Alternatives
The current main alternative for a C based parser combinator library is a branch of Cesium3.
mpc provides a number of features that this project does not offer, and also overcomes a number of potential downsides:
- mpc Works for Generic Types
- mpc Doesn't rely on Boehm-Demers-Weiser Garbage Collection
- mpc Doesn't use
setjmp
andlongjmp
for errors - mpc Doesn't pollute the namespace
Quickstart
Here is how one would use mpc to create a parser for a basic mathematical expression language.
mpc_parser_t *Expr = mpc_new("expression");
mpc_parser_t *Prod = mpc_new("product");
mpc_parser_t *Value = mpc_new("value");
mpc_parser_t *Maths = mpc_new("maths");
mpca_lang(MPCA_LANG_DEFAULT,
" expression : <product> (('+' | '-') <product>)*; "
" product : <value> (('*' | '/') <value>)*; "
" value : /[0-9]+/ | '(' <expression> ')'; "
" maths : /^/ <expression> /$/; ",
Expr, Prod, Value, Maths, NULL);
mpc_result_t r;
if (mpc_parse("input", input, Maths, &r)) {
mpc_ast_print(r.output);
mpc_ast_delete(r.output);
} else {
mpc_err_print(r.error);
mpc_err_delete(r.error);
}
mpc_cleanup(4, Expr, Prod, Value, Maths);
If you were to set input
to the string (4 * 2 * 11 + 2) - 5
, the printed output would look like this.
>
regex
expression|>
value|>
char:1:1 '('
expression|>
product|>
value|regex:1:2 '4'
char:1:4 '*'
value|regex:1:6 '2'
char:1:8 '*'
value|regex:1:10 '11'
char:1:13 '+'
product|value|regex:1:15 '2'
char:1:16 ')'
char:1:18 '-'
product|value|regex:1:20 '5'
regex
Getting Started
Introduction
Parser Combinators are structures that encode how to parse particular languages. They can be combined using intuitive operators to create new parsers of increasing complexity. Using these operators detailed grammars and languages can be parsed and processed in a quick, efficient, and easy way.
The trick behind Parser Combinators is the observation that by structuring the library in a particular way, one can make building parser combinators look like writing a grammar itself. Therefore instead of describing how to parse a language, a user must only specify the language itself, and the library will work out how to parse it ... as if by magic!
mpc can be used in this mode, or, as shown in the above example, you can specify the grammar directly as a string or in a file.
Basic Parsers
String Parsers
All the following functions construct new basic parsers of the type mpc_parser_t *
. All of those parsers return a newly allocated char *
with the character(s) they manage to match. If unsuccessful they will return an error. They have the following functionality.
mpc_parser_t *mpc_any(void);
Matches any individual character
mpc_parser_t *mpc_char(char c);
Matches a single given character c
mpc_parser_t *mpc_range(char s, char e);
Matches any single given character in the range s
to e
(inclusive)
mpc_parser_t *mpc_oneof(const char *s);
Matches any single given character in the string s
mpc_parser_t *mpc_noneof(const char *s);
Matches any single given character not in the string s
mpc_parser_t *mpc_satisfy(int(*f)(char));
Matches any single given character satisfying function f
mpc_parser_t *mpc_string(const char *s);
Matches exactly the string s
Other Parsers
Several other functions exist that construct parsers with some other special functionality.
mpc_parser_t *mpc_pass(void);
Consumes no input, always successful, returns NULL
mpc_parser_t *mpc_fail(const char *m);
mpc_parser_t *mpc_failf(const char *fmt, ...);
Consumes no input, always fails with message m
or formatted string fmt
.
mpc_parser_t *mpc_lift(mpc_ctor_t f);
Consumes no input, always successful, returns the result of function f
mpc_parser_t *mpc_lift_val(mpc_val_t *x);
Consumes no input, always successful, returns x
mpc_parser_t *mpc_state(void);
Consumes no input, always successful, returns a copy of the parser state as a mpc_state_t *
. This state is newly allocated and so needs to be released with free
when finished with.
mpc_parser_t *mpc_anchor(int(*f)(char,char));
Consumes no input. Successful when function f
returns true. Always returns NULL
.
Function f
is a anchor function. It takes as input the last character parsed, and the next character in the input, and returns success or failure. This function can be set by the user to ensure some condition is met. For example to test that the input is at a boundary between words and non-words.
At the start of the input the first argument is set to '\0'
. At the end of the input the second argument is set to '\0'
.
Parsing
Once you've build a parser, you can run it on some input using one of the following functions. These functions return 1
on success and 0
on failure. They output either the result, or an error to a mpc_result_t
variable. This type is defined as follows.
typedef union {
mpc_err_t *error;
mpc_val_t *output;
} mpc_result_t;
where mpc_val_t *
is synonymous with void *
and simply represents some pointer to data - the exact type of which is dependant on the parser.
int mpc_parse(const char *filename, const char *string, mpc_parser_t *p, mpc_result_t *r);
Run a parser on some string.
int mpc_parse_file(const char *filename, FILE *file, mpc_parser_t *p, mpc_result_t *r);
Run a parser on some file.
int mpc_parse_pipe(const char *filename, FILE *pipe, mpc_parser_t *p, mpc_result_t *r);
Run a parser on some pipe (such as stdin
).
int mpc_parse_contents(const char *filename, mpc_parser_t *p, mpc_result_t *r);
Run a parser on the contents of some file.
Combinators
Combinators are functions that take one or more parsers and return a new parser of some given functionality.
These combinators work independently of exactly what data type the parser(s) supplied as input return. In languages such as Haskell ensuring you don't input one type of data into a parser requiring a different type is done by the compiler. But in C we don't have that luxury. So it is at the discretion of the programmer to ensure that he or she deals correctly with the outputs of different parser types.
A second annoyance in C is that of manual memory management. Some parsers might get half-way and then fail. This means they need to clean up any partial result that has been collected in the parse. In Haskell this is handled by the Garbage Collector, but in C these combinators will need to take destructor functions as input, which say how clean up any partial data that has been collected.
Here are the main combinators and how to use then.
mpc_parser_t *mpc_expect(mpc_parser_t *a, const char *e);
mpc_parser_t *mpc_expectf(mpc_parser_t *a, const char *fmt, ...);
Returns a parser that runs a
, and on success returns the result of a
, while on failure reports that e
was expected.
mpc_parser_t *mpc_apply(mpc_parser_t *a, mpc_apply_t f);
mpc_parser_t *mpc_apply_to(mpc_parser_t *a, mpc_apply_to_t f, void *x);
Returns a parser that applies function f
(optionality taking extra input x
) to the result of parser a
.
mpc_parser_t *mpc_check(mpc_parser_t *a, mpc_dtor_t da, mpc_check_t f, const char *e);
mpc_parser_t *mpc_check_with(mpc_parser_t *a, mpc_dtor_t da, mpc_check_with_t f, void *x, const char *e);
mpc_parser_t *mpc_checkf(mpc_parser_t *a, mpc_dtor_t da, mpc_check_t f, const char *fmt, ...);
mpc_parser_t *mpc_check_withf(mpc_parser_t *a, mpc_dtor_t da, mpc_check_with_t f, void *x, const char *fmt, ...);
Returns a parser that applies function f
(optionally taking extra input x
) to the result of parser a
. If f
returns non-zero, then the parser succeeds and returns the value of a
(possibly modified by f
). If f
returns zero, then the parser fails with message e
, and the result of a
is destroyed with the destructor da
.
mpc_parser_t *mpc_not(mpc_parser_t *a, mpc_dtor_t da);
mpc_parser_t *mpc_not_lift(mpc_parser_t *a, mpc_dtor_t da, mpc_ctor_t lf);
Returns a parser with the following behaviour. If parser a
succeeds, then it fails and consumes no input. If parser a
fails, then it succeeds, consumes no input and returns NULL
(or the result of lift function lf
). Destructor da
is used to destroy the result of a
on success.
mpc_parser_t *mpc_maybe(mpc_parser_t *a);
mpc_parser_t *mpc_maybe_lift(mpc_parser_t *a, mpc_ctor_t lf);
Returns a parser that runs a
. If a
is successful then it returns the result of a
. If a
is unsuccessful then it succeeds, but returns NULL
(or the result of lf
).
mpc_parser_t *mpc_many(mpc_fold_t f, mpc_parser_t *a);
Runs a
zero or more times until it fails. Results are combined using fold function f
. See the Function Types section for more details.
mpc_parser_t *mpc_many1(mpc_fold_t f, mpc_parser_t *a);
Runs a
one or more times until it fails. Results are combined with fold function f
.
mpc_parser_t *mpc_sepby1(mpc_fold_t f, mpc_parser_t *sep, mpc_parser_t *a);
Runs a
one or more times, separated by sep
. Results are combined with fold function f
.
mpc_parser_t *mpc_count(int n, mpc_fold_t f, mpc_parser_t *a, mpc_dtor_t da);
Runs a
exactly n
times. If this fails, any partial results are destructed with da
. If successful results of a
are combined using fold function f
.
mpc_parser_t *mpc_or(int n, ...);
Attempts to run n
parsers in sequence, returning the first one that succeeds. If all fail, returns an error.
mpc_parser_t *mpc_and(int n, mpc_fold_t f, ...);
Attempts to run n
parsers in sequence, returning the fold of the results using fold function f
. First parsers must be specified, followed by destructors for each parser, excluding the final parser. These are used in case of partial success. For example: mpc_and(3, mpcf_strfold, mpc_char('a'), mpc_char('b'), mpc_char('c'), free, free);
would attempt to match 'a'
followed by 'b'
followed by 'c'
, and if successful would concatenate them using mpcf_strfold
. Otherwise would use free
on the partial results.
mpc_parser_t *mpc_predictive(mpc_parser_t *a);
Returns a parser that runs a
with backtracking disabled. This means if a
consumes more than one character, it will not be reverted, even on failure. Turning backtracking off has good performance benefits for grammars which are LL(1)
. These are grammars where the first character completely determines the parse result - such as the decision of parsing either a C identifier, number, or string literal. This option should not be used for non LL(1)
grammars or it will produce incorrect results or crash the parser.
Another way to think of mpc_predictive
is that it can be applied to a parser (for a performance improvement) if either successfully parsing the first character will result in a completely successful parse, or all of the referenced sub-parsers are also LL(1)
.
Function Types
The combinator functions take a number of special function types as function pointers. Here is a short explanation of those types are how they are expected to behave. It is important that these behave correctly otherwise it is easy to introduce memory leaks or crashes into the system.
typedef void(*mpc_dtor_t)(mpc_val_t*);
Given some pointer to a data value it will ensure the memory it points to is freed correctly.
typedef mpc_val_t*(*mpc_ctor_t)(void);
Returns some data value when called. It can be used to create empty versions of data types when certain combinators have no known default value to return. For example it may be used to return a newly allocated empty string.
typedef mpc_val_t*(*mpc_apply_t)(mpc_val_t*);
typedef mpc_val_t*(*mpc_apply_to_t)(mpc_val_t*,void*);
This takes in some pointer to data and outputs some new or modified pointer to data, ensuring to free the input data if it is no longer used. The apply_to
variation takes in an extra pointer to some data such as global state.
typedef int(*mpc_check_t)(mpc_val_t**);
typedef int(*mpc_check_with_t)(mpc_val_t**,void*);
This takes in some pointer to data and outputs 0 if parsing should stop with an error. Additionally, this may change or free the input data. The check_with
variation takes in an extra pointer to some data such as global state.
typedef mpc_val_t*(*mpc_fold_t)(int,mpc_val_t**);
This takes a list of pointers to data values and must return some combined or folded version of these data values. It must ensure to free any input data that is no longer used once the combination has taken place.
Case Study - Identifier
Combinator Method
Using the above combinators we can create a parser that matches a C identifier.
When using the combinators we need to supply a function that says how to combine two char *
.
For this we build a fold function that will concatenate zero or more strings together. For this sake of this tutorial we will write it by hand, but this (as well as many other useful fold functions), are actually included in mpc under the mpcf_*
namespace, such as mpcf_strfold
.
mpc_val_t *strfold(int n, mpc_val_t **xs) {
char *x = calloc(1, 1);
int i;
for (i = 0; i < n; i++) {
x = realloc(x, strlen(x) + strlen(xs[i]) + 1);
strcat(x, xs[i]);
free(xs[i]);
}
return x;
}
We can use this to specify a C identifier, making use of some combinators to say how the basic parsers are combined.
mpc_parser_t *alpha = mpc_or(2, mpc_range('a', 'z'), mpc_range('A', 'Z'));
mpc_parser_t *digit = mpc_range('0', '9');
mpc_parser_t *underscore = mpc_char('_');
mpc_parser_t *ident = mpc_and(2, strfold,
mpc_or(2, alpha, underscore),
mpc_many(strfold, mpc_or(3, alpha, digit, underscore)),
free);
/* Do Some Parsing... */
mpc_delete(ident);
Notice that previous parsers are used as input to new parsers we construct from the combinators. Note that only the final parser ident
must be deleted. When we input a parser into a combinator we should consider it to be part of the output of that combinator.
Because of this we shouldn't create a parser and input it into multiple places, or it will be doubly freed.
Regex Method
There is an easier way to do this than the above method. mpc comes with a handy regex function for constructing parsers using regex syntax. We can specify an identifier using a regex pattern as shown below.
mpc_parser_t *ident = mpc_re("[a-zA-Z_][a-zA-Z_0-9]*");
/* Do Some Parsing... */
mpc_delete(ident);
Library Method
Although if we really wanted to create a parser for C identifiers, a function for creating this parser comes included in mpc along with many other common parsers.
mpc_parser_t *ident = mpc_ident();
/* Do Some Parsing... */
mpc_delete(ident);
Parser References
Building parsers in the above way can have issues with self-reference or cyclic-reference. To overcome this we can separate the construction of parsers into two different steps. Construction and Definition.
mpc_parser_t *mpc_new(const char *name);
This will construct a parser called name
which can then be used as input to others, including itself, without fear of being deleted. Any parser created using mpc_new
is said to be retained. This means it will behave differently to a normal parser when referenced. When deleting a parser that includes a retained parser, the retained parser will not be deleted along with it. To delete a retained parser mpc_delete
must be used on it directly.
A retained parser can then be defined using...
mpc_parser_t *mpc_define(mpc_parser_t *p, mpc_parser_t *a);
This assigns the contents of parser a
to p
, and deletes a
. With this technique parsers can now reference each other, as well as themselves, without trouble.
mpc_parser_t *mpc_undefine(mpc_parser_t *p);
A final step is required. Parsers that reference each other must all be undefined before they are deleted. It is important to do any undefining before deletion. The reason for this is that to delete a parser it must look at each sub-parser that is used by it. If any of these have already been deleted a segfault is unavoidable - even if they were retained beforehand.
void mpc_cleanup(int n, ...);
To ease the task of undefining and then deleting parsers mpc_cleanup
can be used. It takes n
parsers as input, and undefines them all, before deleting them all.
mpc_parser_t *mpc_copy(mpc_parser_t *a);
This function makes a copy of a parser a
. This can be useful when you want to
use a parser as input for some other parsers multiple times without retaining
it.
mpc_parser_t *mpc_re(const char *re);
mpc_parser_t *mpc_re_mode(const char *re, int mode);
This function takes as input the regular expression re
and builds a parser
for it. With the mpc_re_mode
function optional mode flags can also be given.
Available flags are MPC_RE_MULTILINE
/ MPC_RE_M
where the start of input
character ^
also matches the beginning of new lines and the end of input $
character also matches new lines, and MPC_RE_DOTALL
/ MPC_RE_S
where the
any character token .
also matches newlines (by default it doesn't).
Library Reference
Common Parsers
Useful Parsers
Apply Functions
Fold Functions
Case Study - Maths Language
Combinator Approach
Passing around all these function pointers might seem clumsy, but having parsers be type-generic is important as it lets users define their own output types for parsers. For example we could design our own syntax tree type to use. We can also use this method to do some specific house-keeping or data processing in the parsing phase.
As an example of this power, we can specify a simple maths grammar, that outputs int *
, and computes the result of the expression as it goes along.
We start with a fold function that will fold two int *
into a new int *
based on some char *
operator.
mpc_val_t *fold_maths(int n, mpc_val_t **xs) {
int **vs = (int**)xs;
if (strcmp(xs[1], "*") == 0) { *vs[0] *= *vs[2]; }
if (strcmp(xs[1], "/") == 0) { *vs[0] /= *vs[2]; }
if (strcmp(xs[1], "%") == 0) { *vs[0] %= *vs[2]; }
if (strcmp(xs[1], "+") == 0) { *vs[0] += *vs[2]; }
if (strcmp(xs[1], "-") == 0) { *vs[0] -= *vs[2]; }
free(xs[1]); free(xs[2]);
return xs[0];
}
And then we use this to specify a basic grammar, which folds together any results.
mpc_parser_t *Expr = mpc_new("expr");
mpc_parser_t *Factor = mpc_new("factor");
mpc_parser_t *Term = mpc_new("term");
mpc_parser_t *Maths = mpc_new("maths");
mpc_define(Expr, mpc_or(2,
mpc_and(3, fold_maths,
Factor, mpc_oneof("+-"), Factor,
free, free),
Factor
));
mpc_define(Factor, mpc_or(2,
mpc_and(3, fold_maths,
Term, mpc_oneof("*/"), Term,
free, free),
Term
));
mpc_define(Term, mpc_or(2, mpc_int(), mpc_parens(Expr, free)));
mpc_define(Maths, mpc_whole(Expr, free));
/* Do Some Parsing... */
mpc_delete(Maths);
If we supply this function with something like (4*2)+5
, we can expect it to output 13
.
Language Approach
It is possible to avoid passing in and around all those function pointers, if you don't care what type is output by mpc. For this, a generic Abstract Syntax Tree type mpc_ast_t
is included in mpc. The combinator functions which act on this don't need information on how to destruct or fold instances of the result as they know it will be a mpc_ast_t
. So there are a number of combinator functions which work specifically (and only) on parsers that return this type. They reside under mpca_*
.
Doing things via this method means that all the data processing must take place after the parsing. In many instances this is not an issue, or even preferable.
It also allows for one more trick. As all the fold and destructor functions are implicit, the user can simply specify the grammar of the language in some nice way and the system can try to build a parser for the AST type from this alone. For this there are a few functions supplied which take in a string, and output a parser. The format for these grammars is simple and familiar to those who have used parser generators before. It looks something like this.
number "number" : /[0-9]+/ ;
expression : <product> (('+' | '-') <product>)* ;
product : <value> (('*' | '/') <value>)* ;
value : <number> | '(' <expression> ')' ;
maths : /^/ <expression> /$/ ;
The syntax for this is defined as follows.
Rules are specified by rule name, optionally followed by an expected string, followed by a colon :
, followed by the definition, and ending in a semicolon ;
. Multiple rules can be specified. The rule names must match the names given to any parsers created by mpc_new
, otherwise the function will crash.
The flags variable is a set of flags MPCA_LANG_DEFAULT
, MPCA_LANG_PREDICTIVE
, or MPCA_LANG_WHITESPACE_SENSITIVE
. For specifying if the language is predictive or whitespace sensitive.
Like with the regular expressions, this user input is parsed by existing parts of the mpc library. It provides one of the more powerful features of the library.
mpc_parser_t *mpca_grammar(int flags, const char *grammar, ...);
This takes in some single right hand side of a rule, as well as a list of any of the parsers referenced, and outputs a parser that does what is specified by the rule. The list of parsers referenced can be terminated with NULL
to get an error instead of a crash when a parser required is not supplied.
mpc_err_t *mpca_lang(int flags, const char *lang, ...);
This takes in a full language (zero or more rules) as well as any parsers referred to by either the right or left hand sides. Any parsers specified on the left hand side of any rule will be assigned a parser equivalent to what is specified on the right. On valid user input this returns NULL
, while if there are any errors in the user input it will return an instance of mpc_err_t
describing the issues. The list of parsers referenced can be terminated with NULL
to get an error instead of a crash when a parser required is not supplied.
mpc_err_t *mpca_lang_file(int flags, FILE* f, ...);
This reads in the contents of file f
and inputs it into mpca_lang
.
mpc_err_t *mpca_lang_contents(int flags, const char *filename, ...);
This opens and reads in the contents of the file given by filename
and passes it to mpca_lang
.
Case Study - Tokenizer
Another common task we might be interested in doing is tokenizing some block of
text (splitting the text into individual elements) and performing some function
on each one of these elements as it is read. We can do this with mpc
too.
First, we can build a regular expression which parses an individual token. For
example if our tokens are identifiers, integers, commas, periods and colons we
could build something like this mpc_re("\\s*([a-zA-Z_]+|[0-9]+|,|\\.|:)")
.
Next we can strip any whitespace, and add a callback function using mpc_apply
which gets called every time this regex is parsed successfully
mpc_apply(mpc_strip(mpc_re("\\s*([a-zA-Z_]+|[0-9]+|,|\\.|:)")), print_token)
.
Finally we can surround all of this in mpc_many
to parse it zero or more
times. The final code might look something like this:
static mpc_val_t *print_token(mpc_val_t *x) {
printf("Token: '%s'\n", (char*)x);
return x;
}
int main(int argc, char **argv) {
const char *input = " hello 4352 , \n foo.bar \n\n test:ing ";
mpc_parser_t* Tokens = mpc_many(
mpcf_all_free,
mpc_apply(mpc_strip(mpc_re("\\s*([a-zA-Z_]+|[0-9]+|,|\\.|:)")), print_token));
mpc_result_t r;
mpc_parse("input", input, Tokens, &r);
mpc_delete(Tokens);
return 0;
}
Running this program will produce an output something like this:
Token: 'hello'
Token: '4352'
Token: ','
Token: 'foo'
Token: '.'
Token: 'bar'
Token: 'test'
Token: ':'
Token: 'ing'
By extending the regex we can easily extend this to parse many more types of tokens and quickly and easily build a tokenizer for whatever language we are interested in.
Error Reporting
mpc provides some automatic generation of error messages. These can be enhanced by the user, with use of mpc_expect
, but many of the defaults should provide both useful and readable. An example of an error message might look something like this:
<test>:0:3: error: expected one or more of 'a' or 'd' at 'k'
Misc
Here are some other misc functions that mpc provides. These functions are susceptible to change between versions so use them with some care.
void mpc_print(mpc_parser_t *p);
Prints out a parser in some weird format. This is generally used for debugging so don't expect to be able to understand the output right away without looking at the source code a little bit.
void mpc_stats(mpc_parser_t *p);
Prints out some basic stats about a parser. Again used for debugging and optimisation.
void mpc_optimise(mpc_parser_t *p);
Performs some basic optimisations on a parser to reduce it's size and increase its running speed.
Limitations & FAQ
I'm getting namespace issues due to libmpc
, what can I do?
There is a re-naming of this project to pcq
hosted on the pcq branch which should be usable without namespace issues.
Does mpc support Unicode?
mpc Only supports ASCII. Sorry! Writing a parser library that supports Unicode is pretty difficult. I welcome contributions!
Is mpc binary safe?
No. Sorry! Including NULL characters in a string or a file will probably break it. Avoid this if possible.
The Parser is going into an infinite loop!
While it is certainly possible there is an issue with mpc, it is probably the case that your grammar contains left recursion. This is something mpc cannot deal with. Left recursion is when a rule directly or indirectly references itself on the left hand side of a derivation. For example consider this left recursive grammar intended to parse an expression.
expr : <expr> '+' (<expr> | <int> | <string>);
When the rule expr
is called, it looks the first rule on the left. This happens to be the rule expr
again. So again it looks for the first rule on the left. Which is expr
again. And so on. To avoid left recursion this can be rewritten (for example) as the following. Note that rewriting as follows also changes the operator associativity.
value : <int> | <string> ;
expr : <value> ('+' <expr>)* ;
Avoiding left recursion can be tricky, but is easy once you get a feel for it. For more information you can look on wikipedia which covers some common techniques and more examples. Possibly in the future mpc will support functionality to warn the user or re-write grammars which contain left recursion, but it wont for now.
Backtracking isn't working!
mpc supports backtracking, but it may not work as you expect. It isn't a silver bullet, and you still must structure your grammar to be unambiguous. To demonstrate this behaviour examine the following erroneous grammar, intended to parse either a C style identifier, or a C style function call.
factor : <ident>
| <ident> '(' <expr>? (',' <expr>)* ')' ;
This grammar will never correctly parse a function call because it will always first succeed parsing the initial identifier and return a factor. At this point it will encounter the parenthesis of the function call, give up, and throw an error. Even if it were to try and parse a factor again on this failure it would never reach the correct function call option because it always tries the other options first, and always succeeds with the identifier.
The solution to this is to always structure grammars with the most specific clause first, and more general clauses afterwards. This is the natural technique used for avoiding left-recursive grammars and unambiguity, so is a good habit to get into anyway.
Now the parser will try to match a function first, and if this fails backtrack and try to match just an identifier.
factor : <ident> '(' <expr>? (',' <expr>)* ')'
| <ident> ;
An alternative, and better option is to remove the ambiguity completely by factoring out the first identifier. This is better because it removes any need for backtracking at all! Now the grammar is predictive!
factor : <ident> ('(' <expr>? (',' <expr>)* ')')? ;
How can I avoid the maximum string literal length?
Some compilers limit the maximum length of string literals. If you have a huge language string in the source file to be passed into mpca_lang
you might encounter this. The ANSI standard says that 509 is the maximum length allowed for a string literal. Most compilers support greater than this. Visual Studio supports up to 2048 characters, while gcc allocates memory dynamically and so has no real limit.
There are a couple of ways to overcome this issue if it arises. You could instead use mpca_lang_contents
and load the language from file or you could use a string literal for each line and let the preprocessor automatically concatenate them together, avoiding the limit. The final option is to upgrade your compiler. In C99 this limit has been increased to 4095.
The automatic tags in the AST are annoying!
When parsing from a grammar, the abstract syntax tree is tagged with different tags for each primitive type it encounters. For example a regular expression will be automatically tagged as regex
. Character literals as char
and strings as string
. This is to help people wondering exactly how they might need to convert the node contents.
If you have a rule in your grammar called string
, char
or regex
, you may encounter some confusion. This is because nodes will be tagged with (for example) string
either if they are a string primitive, or if they were parsed via your string
rule. If you are detecting node type using something like strstr
, in this situation it might break. One solution to this is to always check that string
is the innermost tag to test for string primitives, or to rename your rule called string
to something that doesn't conflict.
Yes it is annoying but its probably not going to change!
More Resourcesto explore the angular.
mail [email protected] to add your project or resources here 🔥.
- 1Create new page · clibs/clib Wiki
https://github.com/clibs/clib/wiki/Packages.
Package manager for the C programming language. Contribute to clibs/clib development by creating an account on GitHub.
- 2utf8proc/LICENSE.md at master · JuliaStrings/utf8proc
https://github.com/JuliaStrings/utf8proc/blob/master/LICENSE.md
a clean C library for processing UTF-8 Unicode data - JuliaStrings/utf8proc
- 3ape_tag_libs/c at master · jeremyevans/ape_tag_libs
https://github.com/jeremyevans/ape_tag_libs/tree/master/c
Libaries for reading/writing APEv2 tags in many languages - jeremyevans/ape_tag_libs
- 4Build software better, together
https://github.com/clibs/clib.
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
- 5Small strings compression library
https://github.com/antirez/smaz
Small strings compression library. Contribute to antirez/smaz development by creating an account on GitHub.
- 6cmathl/LICENSE at master · ScientificC/cmathl
https://github.com/ScientificC/cmathl/blob/master/LICENSE
A pure-C math library with a great variety of mathematical functions. Seeks to be close to C89/C90 compliant for portability. - ScientificC/cmathl
- 7Minimal unit testing framework for C
https://github.com/siu/minunit
Minimal unit testing framework for C. Contribute to siu/minunit development by creating an account on GitHub.
- 8📚 single header utf8 string functions for C and C++
https://github.com/sheredom/utf8.h
📚 single header utf8 string functions for C and C++ - sheredom/utf8.h
- 9A template system for Emacs
https://github.com/joaotavora/yasnippet
A template system for Emacs. Contribute to joaotavora/yasnippet development by creating an account on GitHub.
- 10Asynchronous networking for C
https://github.com/rxi/dyad
Asynchronous networking for C . Contribute to rxi/dyad development by creating an account on GitHub.
- 11Super Light Regexp engine for C/C++
https://github.com/cesanta/slre
Super Light Regexp engine for C/C++. Contribute to cesanta/slre development by creating an account on GitHub.
- 12Netstring for C
https://github.com/liteserver/netstring-c
Netstring for C. Contribute to liteserver/netstring-c development by creating an account on GitHub.
- 13A protocol buffers library for C
https://github.com/cloudwu/pbc
A protocol buffers library for C. Contribute to cloudwu/pbc development by creating an account on GitHub.
- 14Pblog is a small, low overhead, structured logging library
https://github.com/google/pblog
Pblog is a small, low overhead, structured logging library - google/pblog
- 15Parser combinators for binary formats, in C. Yes, in C. What? Don't look at me like that.
https://github.com/abiggerhammer/hammer
Parser combinators for binary formats, in C. Yes, in C. What? Don't look at me like that. - abiggerhammer/hammer
- 16libelf
https://github.com/WolfgangSt/libelf
libelf. Contribute to WolfgangSt/libelf development by creating an account on GitHub.
- 17Open MPI main development repository
https://github.com/open-mpi/ompi
Open MPI main development repository. Contribute to open-mpi/ompi development by creating an account on GitHub.
- 18Your friendly e-mail address validation library.
https://github.com/dertuxmalwieder/libvldmail
Your friendly e-mail address validation library. Contribute to dertuxmalwieder/libvldmail development by creating an account on GitHub.
- 19A shebang-friendly script for "interpreting" single C99, C11, and C++ files, including rcfile support.
https://github.com/RhysU/c99sh
A shebang-friendly script for "interpreting" single C99, C11, and C++ files, including rcfile support. - RhysU/c99sh
- 20Minimal Huffman coder/decoder
https://github.com/adamierymenko/huffandpuff
Minimal Huffman coder/decoder. Contribute to adamierymenko/huffandpuff development by creating an account on GitHub.
- 21C library/compiler for the Cap'n Proto serialization/RPC protocol
https://github.com/jmckaskill/c-capnproto
C library/compiler for the Cap'n Proto serialization/RPC protocol - jmckaskill/c-capnproto
- 22C-code generator for docopt language.
https://github.com/docopt/docopt.c
C-code generator for docopt language. Contribute to docopt/docopt.c development by creating an account on GitHub.
- 23syntastic/LICENCE at master · vim-syntastic/syntastic
https://github.com/vim-syntastic/syntastic/blob/master/LICENCE
Syntax checking hacks for vim. Contribute to vim-syntastic/syntastic development by creating an account on GitHub.
- 24tiny recursive descent expression parser, compiler, and evaluation engine for math expressions
https://github.com/codeplea/tinyexpr
tiny recursive descent expression parser, compiler, and evaluation engine for math expressions - codeplea/tinyexpr
- 25libonion - Coralbits S.L.
https://www.coralbits.com/libonion/
Lightweight C library to add web server functionality to your program libonion is a lightweight library to help you create webservers in C programming language. These webservers may be a web application, a means of expanding your own application to give it web functionality or even a fully featured webserver. The user can create new […]
- 26http request/response parser for c
https://github.com/nodejs/http-parser
http request/response parser for c. Contribute to nodejs/http-parser development by creating an account on GitHub.
- 27commonmark-spec/LICENSE at master · commonmark/commonmark-spec
https://github.com/commonmark/commonmark-spec/blob/master/LICENSE
CommonMark spec, with reference implementations in C and JavaScript - commonmark/commonmark-spec
- 28A tool for use with clang to analyze #includes in C and C++ source files
https://github.com/include-what-you-use/include-what-you-use
A tool for use with clang to analyze #includes in C and C++ source files - include-what-you-use/include-what-you-use
- 29A non-backtracking NFA/DFA-based Perl-compatible regex engine matching on large data streams
https://github.com/openresty/sregex
A non-backtracking NFA/DFA-based Perl-compatible regex engine matching on large data streams - openresty/sregex
- 30A portable foreign-function interface library.
https://github.com/libffi/libffi
A portable foreign-function interface library. Contribute to libffi/libffi development by creating an account on GitHub.
- 31Universal configuration library parser
https://github.com/vstakhov/libucl
Universal configuration library parser. Contribute to vstakhov/libucl development by creating an account on GitHub.
- 32On the fly syntax checking for GNU Emacs
https://github.com/flycheck/flycheck
On the fly syntax checking for GNU Emacs. Contribute to flycheck/flycheck development by creating an account on GitHub.
- 33A Linux packet crafting tool.
https://github.com/rafael-santiago/pig
A Linux packet crafting tool. Contribute to rafael-santiago/pig development by creating an account on GitHub.
- 34A New Kind of Instant Messaging
https://tox.chat/
Whether it's corporations or governments, there's just too much digital spying going on today. Tox is an easy to use application that connects you with friends and family without anyone else listening in. While other big-name services require you to pay for features, Tox is totally free and comes without advertising — forever.
- 35A simple C library for working with KD-Trees
https://github.com/jtsiomb/kdtree
A simple C library for working with KD-Trees. Contribute to jtsiomb/kdtree development by creating an account on GitHub.
- 36A mini C library for interacting with the Twitter OAuth api.
https://github.com/sinemetu1/twitc
A mini C library for interacting with the Twitter OAuth api. - sinemetu1/twitc
- 37Main gperftools repository
https://github.com/gperftools/gperftools
Main gperftools repository. Contribute to gperftools/gperftools development by creating an account on GitHub.
- 38Lint C-based files using Clang.
https://github.com/AtomLinter/linter-clang
Lint C-based files using Clang. Contribute to AtomLinter/linter-clang development by creating an account on GitHub.
- 39WAFer is a C language-based software platform for scalable server-side and networking applications. Think node.js for C programmers.
https://github.com/riolet/WAFer
WAFer is a C language-based software platform for scalable server-side and networking applications. Think node.js for C programmers. - riolet/WAFer
- 40ini file parser
https://github.com/ndevilla/iniparser
ini file parser. Contribute to ndevilla/iniparser development by creating an account on GitHub.
- 41simple neural network library in ANSI C
https://github.com/codeplea/genann
simple neural network library in ANSI C. Contribute to codeplea/genann development by creating an account on GitHub.
- 42An eventing framework for building high performance and high scalability systems in C.
https://github.com/facebookarchive/libphenom
An eventing framework for building high performance and high scalability systems in C. - facebookarchive/libphenom
- 43A cross-platform protocol library to communicate with iOS devices
https://github.com/libimobiledevice/libimobiledevice
A cross-platform protocol library to communicate with iOS devices - libimobiledevice/libimobiledevice
- 44H2O - the optimized HTTP/1, HTTP/2, HTTP/3 server
https://github.com/h2o/h2o/
H2O - the optimized HTTP/1, HTTP/2, HTTP/3 server. Contribute to h2o/h2o development by creating an account on GitHub.
- 45A portable MQTT C client for embedded systems and PCs alike.
https://github.com/LiamBindle/MQTT-C
A portable MQTT C client for embedded systems and PCs alike. - LiamBindle/MQTT-C
- 46Binary Serialization
https://github.com/liteserver/binn
Binary Serialization. Contribute to liteserver/binn development by creating an account on GitHub.
- 47Package manager for the C programming language.
https://github.com/clibs/clib
Package manager for the C programming language. Contribute to clibs/clib development by creating an account on GitHub.
- 48Yet another INI parser
https://github.com/madmurphy/libconfini
Yet another INI parser. Contribute to madmurphy/libconfini development by creating an account on GitHub.
- 49C-Library for unit testing.
https://github.com/rafael-santiago/cutest
C-Library for unit testing. Contribute to rafael-santiago/cutest development by creating an account on GitHub.
- 50A Parser Combinator library for C
https://github.com/orangeduck/mpc
A Parser Combinator library for C. Contribute to orangeduck/mpc development by creating an account on GitHub.
- 51An implementation of the MessagePack serialization format in C / msgpack.org[C]
https://github.com/camgunz/cmp
An implementation of the MessagePack serialization format in C / msgpack.org[C] - camgunz/cmp
- 52Platform independent Near Field Communication (NFC) library
https://github.com/nfc-tools/libnfc
Platform independent Near Field Communication (NFC) library - nfc-tools/libnfc
- 53Lightweight exception implementation for C
https://github.com/ThrowTheSwitch/CException
Lightweight exception implementation for C. Contribute to ThrowTheSwitch/CException development by creating an account on GitHub.
- 54CommonMark spec, with reference implementations in C and JavaScript
https://github.com/commonmark/commonmark-spec
CommonMark spec, with reference implementations in C and JavaScript - commonmark/commonmark-spec
- 55AddressSanitizer, ThreadSanitizer, MemorySanitizer
https://github.com/google/sanitizers
AddressSanitizer, ThreadSanitizer, MemorySanitizer - google/sanitizers
- 56a clean C library for processing UTF-8 Unicode data
https://github.com/JuliaStrings/utf8proc
a clean C library for processing UTF-8 Unicode data - JuliaStrings/utf8proc
- 57nanomsg library
https://github.com/nanomsg/nanomsg
nanomsg library. Contribute to nanomsg/nanomsg development by creating an account on GitHub.
- 58libusb/COPYING at master · libusb/libusb
https://github.com/libusb/libusb/blob/master/COPYING
A cross-platform library to access USB devices . Contribute to libusb/libusb development by creating an account on GitHub.
- 59Protocol Buffers implementation in C
https://github.com/protobuf-c/protobuf-c
Protocol Buffers implementation in C. Contribute to protobuf-c/protobuf-c development by creating an account on GitHub.
- 60An HTML5 parsing library in pure C99
https://github.com/google/gumbo-parser
An HTML5 parsing library in pure C99. Contribute to google/gumbo-parser development by creating an account on GitHub.
- 61Wrapper library for the BSD sockets API with a nicer C99 interface
https://github.com/silentbicycle/socket99
Wrapper library for the BSD sockets API with a nicer C99 interface - silentbicycle/socket99
- 62Compile and execute C "scripts" in one go!
https://github.com/ryanmjacobs/c
Compile and execute C "scripts" in one go! Contribute to ryanmjacobs/c development by creating an account on GitHub.
- 63The approximate regex matching library and agrep command line tool.
https://github.com/laurikari/tre/
The approximate regex matching library and agrep command line tool. - laurikari/tre
- 64MPack - A C encoder/decoder for the MessagePack serialization format / msgpack.org[C]
https://github.com/ludocode/mpack
MPack - A C encoder/decoder for the MessagePack serialization format / msgpack.org[C] - ludocode/mpack
- 65ARCHIVED - libbson has moved to https://github.com/mongodb/mongo-c-driver/tree/master/src/libbson
https://github.com/mongodb/libbson
ARCHIVED - libbson has moved to https://github.com/mongodb/mongo-c-driver/tree/master/src/libbson - mongodb/libbson
- 66A cross platform C99 library to get cpu features at runtime.
https://github.com/google/cpu_features
A cross platform C99 library to get cpu features at runtime. - google/cpu_features
- 67RabbitMQ C client
https://github.com/alanxz/rabbitmq-c
RabbitMQ C client. Contribute to alanxz/rabbitmq-c development by creating an account on GitHub.
- 68Home - OpenMP
https://www.openmp.org/
yes
- 69Simple Dynamic Strings library for C
https://github.com/antirez/sds
Simple Dynamic Strings library for C. Contribute to antirez/sds development by creating an account on GitHub.
- 70OpenCL - The Open Standard for Parallel Programming of Heterogeneous Systems
https://www.khronos.org/opencl/
OpenCL™ (Open Computing Language) is an open, royalty-free standard for cross-platform, parallel programming of diverse accelerators found in supercomputers, cloud servers, personal computers, mobile devices and embedded platforms. OpenCL greatly improves the speed and responsiveness of a wide spectrum of applications in numerous market categories including professional creative tools,
- 71Syntax checking hacks for vim
https://github.com/vim-syntastic/syntastic
Syntax checking hacks for vim. Contribute to vim-syntastic/syntastic development by creating an account on GitHub.
- 72aosp-mirror/platform_bionic
https://github.com/aosp-mirror/platform_bionic
Contribute to aosp-mirror/platform_bionic development by creating an account on GitHub.
- 73regexp4 engine (C-lang)
https://github.com/nasciiboy/recursiveregexpraptor-4
regexp4 engine (C-lang). Contribute to nasciiboy/RecursiveRegexpRaptor-4 development by creating an account on GitHub.
- 74libgit2/COPYING at main · libgit2/libgit2
https://github.com/libgit2/libgit2/blob/master/COPYING
A cross-platform, linkable library implementation of Git that you can use in your application. - libgit2/libgit2
- 75capstone/LICENSE.TXT at master · capstone-engine/capstone
https://github.com/aquynh/capstone/blob/master/LICENSE.TXT
Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, T...
- 76An implementation of the TLS/SSL protocols
https://github.com/awslabs/s2n
An implementation of the TLS/SSL protocols. Contribute to aws/s2n-tls development by creating an account on GitHub.
- 77Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
https://github.com/aquynh/capstone
Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, T...
- 78Atom-linter extension to lint C/C++ source files using gcc/g++
https://github.com/hebaishi/linter-gcc
Atom-linter extension to lint C/C++ source files using gcc/g++ - AtomLinter/linter-gcc
- 79🚀 Making multi-player gamedev simpler since 2017
https://github.com/librg/librg
🚀 Making multi-player gamedev simpler since 2017. Contribute to zpl-c/librg development by creating an account on GitHub.
- 80Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C
https://github.com/rampantpixels/rpmalloc
Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C - mjansson/rpmalloc
- 81The 2-Clause BSD License
https://opensource.org/licenses/BSD-2-Clause
Note: This license has also been called the “Simplified BSD License” and the “FreeBSD License”. See also the 3-clause BSD License. Copyright <YEAR> <COPYRIGHT HOLDER> Redistribution and use in source…
- 82ICU - International Components for Unicode
http://site.icu-project.org/
News 2024-04-17: ICU 75 is now available. It updates to CLDR 45 (beta blog) locale data with new locales and various additions and corrections. C++ code now requires C++17 and is being made more robust. The CLDR MessageFormat 2.0 specification is now in technology preview, together with a
- 83Understanding and Using C Pointers
http://shop.oreilly.com/product/0636920028000.do
Improve your programming through a solid understanding of C pointers and memory management. With this practical book, you’ll learn how pointers provide the mechanism to dynamically manipulate memory, enhance support … - Selection from Understanding and Using C Pointers [Book]
- 8421st Century C, 2nd Edition
http://shop.oreilly.com/product/0636920033677.do
Throw out your old ideas of C, and relearn a programming language that’s substantially outgrown its origins. With this revised edition of 21st Century C, you’ll discover up-to-date techniques … - Selection from 21st Century C, 2nd Edition [Book]
- 85Jens Gustedt / P99 - macros and functions for C99 · GitLab
http://p99.gforge.inria.fr/
P99 is a suite of macro and function definitions that ease the programming in C99, aka C 1999. By using new tools from C99 we implement default arguments...
- 86C Pocket Reference
http://shop.oreilly.com/product/9780596004361.do
C is one of the oldest programming languages and still one of the most widely used. Whether you're an experienced C programmer or you're new to the language, you know … - Selection from C Pocket Reference [Book]
- 87Head First C
http://shop.oreilly.com/product/0636920015482.do
Ever wished you could learn C from a book? Head First C provides a complete learning experience for C and structured imperative programming. With a unique method that goes beyond … - Selection from Head First C [Book]
- 88Throw The Switch
http://www.throwtheswitch.org/
Unit Testing (TDD) Embedded C Code. Making Awesome and Reliable Firmware in C Doesn't Have to Suck.
- 89Projects
http://source.icu-project.org/repos/icu/icu/tags/latest/LICENSE
Projects The Unicode StandardThe Unicode Standard is a character coding system designed to support the worldwide interchange, processing, and display of the written texts of the diverse languages and technical disciplines of the modern world. In addition, it supports classical and historical texts of many written languages. Unicode CLDR (Common Locale
- 90A fast build tool
https://buck.build/
This project is no longer actively maintained. Please see https://buck2.build for the build system that replaces it. Old content continues below for historical purposes. Buck is a build system developed and used by Facebook. It encourages the creation of small, reusable modules consisting of code and resources, and supports a variety of languages.
- 91Build software better, together
https://github.com/eug/awesome-opengl.
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
- 92Home
https://github.com/json-c/json-c/wiki
https://github.com/json-c/json-c is the official code repository for json-c. See the wiki for release tarballs for download. API docs at http://json-c.github.io/json-c/ - json-c/json-c
- 93Home
https://github.com/rib/cogl-web/wiki
The cogl3d.org website content. Contribute to rib/cogl-web development by creating an account on GitHub.
- 94qtbase/LICENSE.GPL3-EXCEPT at 5.11 · qt/qtbase
https://github.com/qt/qtbase/blob/5.11/LICENSE.GPL3-EXCEPT
Qt Base (Core, Gui, Widgets, Network, ...). Contribute to qt/qtbase development by creating an account on GitHub.
- 95Build software better, together
https://github.com/vinjn/awesome-vulkan.
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
- 96Home
https://github.com/netmail-open/wjelement/wiki
advanced, flexible JSON manipulation in C. Contribute to netmail-open/wjelement development by creating an account on GitHub.
- 97C99 heightmap utilities.
https://github.com/prideout/heman
C99 heightmap utilities. Contribute to prideout/heman development by creating an account on GitHub.
- 98Read-only mirror of official repo on openldap.org. Issues and pull requests here are ignored. Use OpenLDAP ITS for issues.
https://github.com/LMDB/lmdb
Read-only mirror of official repo on openldap.org. Issues and pull requests here are ignored. Use OpenLDAP ITS for issues. - LMDB/lmdb
- 99contiki/LICENSE at master · contiki-os/contiki
https://github.com/contiki-os/contiki/blob/master/LICENSE
The official git repository for Contiki, the open source OS for the Internet of Things - contiki-os/contiki
- 100Intel® Implicit SPMD Program Compiler
https://github.com/ispc/ispc
Intel® Implicit SPMD Program Compiler. Contribute to ispc/ispc development by creating an account on GitHub.
- 101Pure C Game Engine
https://github.com/orangeduck/Corange
Pure C Game Engine. Contribute to orangeduck/Corange development by creating an account on GitHub.
- 102LCUI/LICENSE.TXT at develop · lc-soft/LCUI
https://github.com/lc-soft/LCUI/blob/develop/LICENSE.TXT
C library for building user interfaces. Contribute to lc-soft/LCUI development by creating an account on GitHub.
- 103Parallel, indexed xz compressor
https://github.com/vasi/pixz
Parallel, indexed xz compressor. Contribute to vasi/pixz development by creating an account on GitHub.
- 104Quake GPL Source Release
https://github.com/id-Software/Quake
Quake GPL Source Release. Contribute to id-Software/Quake development by creating an account on GitHub.
- 105a small build system with a focus on speed
https://github.com/ninja-build/ninja
a small build system with a focus on speed. Contribute to ninja-build/ninja development by creating an account on GitHub.
- 106Quake 2 GPL Source Release
https://github.com/id-Software/Quake-2
Quake 2 GPL Source Release. Contribute to id-Software/Quake-2 development by creating an account on GitHub.
- 107libui/LICENSE at master · andlabs/libui
https://github.com/andlabs/libui/blob/master/LICENSE
Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports. - andlabs/libui
- 108stb single-file public domain libraries for C/C++
https://github.com/nothings/stb
stb single-file public domain libraries for C/C++. Contribute to nothings/stb development by creating an account on GitHub.
- 109Murmur3 hash in C
https://github.com/PeterScott/murmur3
Murmur3 hash in C. Contribute to PeterScott/murmur3 development by creating an account on GitHub.
- 110Lightweight JSON library written in C.
https://github.com/kgabis/parson
Lightweight JSON library written in C. Contribute to kgabis/parson development by creating an account on GitHub.
- 111Brotli compression format
https://github.com/google/brotli
Brotli compression format. Contribute to google/brotli development by creating an account on GitHub.
- 112xmake/LICENSE.md at master · xmake-io/xmake
https://github.com/xmake-io/xmake/blob/master/LICENSE.md
🔥 A cross-platform build utility based on Lua. Contribute to xmake-io/xmake development by creating an account on GitHub.
- 113Premake
https://github.com/premake/premake-core
Premake. Contribute to premake/premake-core development by creating an account on GitHub.
- 114Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.
https://github.com/andlabs/libui
Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports. - andlabs/libui
- 115A single-header ANSI C gui library
https://github.com/vurtun/nuklear
A single-header ANSI C gui library. Contribute to vurtun/nuklear development by creating an account on GitHub.
- 116Visual Studio Code - Code Editing. Redefined
https://code.visualstudio.com/
Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.
- 117The GTK Project - A free and open-source cross-platform widget toolkit
https://www.gtk.org/gtk-doc/
GTK is a free and open-source cross-platform widget toolkit for creating graphical user interfaces.
- 118NIH Utility Library
https://github.com/keybuk/libnih
NIH Utility Library. Contribute to keybuk/libnih development by creating an account on GitHub.
- 119raylib
https://www.raylib.com/
raylib is a simple and easy-to-use library to enjoy videogames programming.
- 120The GTK Project - A free and open-source cross-platform widget toolkit
https://www.gtk.org/
GTK is a free and open-source cross-platform widget toolkit for creating graphical user interfaces.
- 121Easy to use, modular, header only, macro based, generic and type-safe Data Structures in C
https://github.com/LeoVen/C-Macro-Collections
Easy to use, modular, header only, macro based, generic and type-safe Data Structures in C - LeoVen/C-Macro-Collections
- 122advanced, flexible JSON manipulation in C
https://github.com/netmail-open/wjelement/
advanced, flexible JSON manipulation in C. Contribute to netmail-open/wjelement development by creating an account on GitHub.
- 123Simple hash table implementation for C.
https://github.com/watmough/jwHash
Simple hash table implementation for C. Contribute to watmough/jwHash development by creating an account on GitHub.
- 124ioquake3
https://ioquake3.org/
Play Quake 3, mods, new games, or make your own!
- 125OpenGL ES - The Standard for Embedded Accelerated 3D Graphics
https://www.khronos.org/opengles/
OpenGL ES is a royalty-free, cross-platform API for full-function 2D and 3D graphics on embedded systems - including consoles, phones, appliances and vehicles.
- 126OpenGL SC - OpenGL graphics for the safety critical industry
https://www.khronos.org/openglsc/
The open standard OpenGL SC Safety Critical Profile is defined to meet the unique needs of the safety-critical market for avionics, industrial, military, medical and automotive applications including D0178-B certification.
- 127Minimalistic C client for Redis >= 1.2
https://github.com/redis/hiredis
Minimalistic C client for Redis >= 1.2. Contribute to redis/hiredis development by creating an account on GitHub.
- 128A fast compressor/decompressor
https://github.com/google/snappy
A fast compressor/decompressor. Contribute to google/snappy development by creating an account on GitHub.
- 129PostgreSQL
https://www.postgresql.org/
The world's most advanced open source database.
- 130Improved JPEG encoder.
https://github.com/mozilla/mozjpeg
Improved JPEG encoder. Contribute to mozilla/mozjpeg development by creating an account on GitHub.
- 131💩 Colour ASCII Art Library
https://github.com/cacalabs/libcaca
💩 Colour ASCII Art Library. Contribute to cacalabs/libcaca development by creating an account on GitHub.
- 132I Do Not Know C
https://kukuruku.co/post/i-do-not-know-c/
The purpose of this article is to make everyone (especially C programmers) say: “I do not know C”. I want to show that the dark corners of C are much closer than it seems, and even trivial code lines may contain undefined behavior. The article is organized as a set of questions and answers. All the examples are separate files of the source code. 1. int i; int i = 10; Q: Is this code correct?
- 133GIFLIB
https://sourceforge.net/projects/giflib/
Download GIFLIB for free. A library and utilities for processing GIFs. giflib is a library for reading and writing gif images. It is API and ABI compatible with libungif which was in wide use while the LZW compression algorithm was patented.
- 134Redis - The Real-time Data Platform
https://redis.io/
Developers love Redis. Unlock the full potential of the Redis database with Redis Enterprise and start building blazing fast apps.
- 135The Developer Data Platform
https://www.mongodb.com/.
Get your ideas to market faster with a developer data platform built on the leading modern database. MongoDB makes working with data easy.
- 136C library for building user interfaces
https://github.com/lc-soft/LCUI/
C library for building user interfaces. Contribute to lc-soft/LCUI development by creating an account on GitHub.
- 137qt-creator/LICENSE.GPL3-EXCEPT at master · qt-creator/qt-creator
https://github.com/qt-creator/qt-creator/blob/master/LICENSE.GPL3-EXCEPT
A cross-platform Qt IDE. Contribute to qt-creator/qt-creator development by creating an account on GitHub.
- 138Learning C with gdb - Blog - Recurse Center
https://www.recurse.com/blog/5-learning-c-with-gdb
The Recurse Center is a self-directed, community-driven educational retreat for programmers in New York City.
- 139Introduction to "Fun" C (using GCC)
https://gist.github.com/eatonphil/21b3d6569f24ad164365
Introduction to "Fun" C (using GCC). GitHub Gist: instantly share code, notes, and snippets.
- 140Open Source Database (RDBMS) for the Enterprise | MariaDB
https://mariadb.com/
MariaDB provides enterprise open source database and cloud managed database services to support scalability, mission-critical deployments, and more.
- 141Introduction to OpenMP - Tim Mattson (Intel)
https://www.youtube.com/playlist?list=PLLX-Q6B8xqZ8n8bwjGdzBJ25X2utwnoEG
Introduction to OpenMP - Tim Mattson (Intel) The OpenMP ARB thanks the University Program Office at Intel for permission to make this tutorial available. Sli...
- 142ispc/LICENSE.txt at main · ispc/ispc
https://github.com/ispc/ispc/blob/master/LICENSE.txt
Intel® Implicit SPMD Program Compiler. Contribute to ispc/ispc development by creating an account on GitHub.
- 143amazon-freertos/LICENSE at main · aws/amazon-freertos
https://github.com/aws/amazon-freertos/blob/master/LICENSE
DEPRECATED - See README.md. Contribute to aws/amazon-freertos development by creating an account on GitHub.
- 144AI-Enhanced Data Solutions with Database 23ai
https://www.oracle.com/database/berkeley-db/
Discover advanced database features like AI, security, and cloud solutions, and optimize your data with Oracle's robust technologies.
- 145qlibc/LICENSE at main · wolkykim/qlibc
https://github.com/wolkykim/qlibc/blob/master/LICENSE
qLibc is a simple and yet powerful C library providing generic data structures and algorithms. - wolkykim/qlibc
- 146One of the fastest hash functions
https://github.com/leo-yuriev/t1ha
One of the fastest hash functions. Contribute to erthink/t1ha development by creating an account on GitHub.
- 147Sunsetting Atom
https://atom.io/
We are archiving Atom and all projects under the Atom organization for an official sunset on December 15, 2022.
- 148Home | Vulkan | Cross platform 3D Graphics
https://www.khronos.org/vulkan/
Vulkan is a next generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in PCs, consoles, mobile phones and embedded platforms.
- 149Mbed TLS
https://tls.mbed.org/
Project implements cryptographic primitives, X.509 certificate manipulation and the SSL/TLS and DTLS protocols.
- 150Situs SBOBET Online Link Daftar SBOBET88 Login Indonesia
http://anjuta.org/
SBOBET88 adalah situs judi bola resmi partner Betwin188 agen sbobet online mobile terpercaya 2024, penyedia link daftar sbobet login indonesia 24jam.
- 151C library for encoding, decoding and manipulating JSON data
http://www.digip.org/jansson/
C library for encoding, decoding and manipulating JSON data - akheron/jansson
- 152Developer Tools & IDE | The Eclipse Foundation
http://www.eclipse.org/ide/
Our community is innovating on the next generation of cloud native developer tools, including the Eclipse IDE which is the leading open platform for …
Related Articlesto learn about angular.
- 1Getting Started with C Programming: Beginner’s Guide
- 2Functions and Pointers in C: Write Efficient Code
- 3Memory Management in C: malloc and free
- 4File Handling in C: Reading and Writing Files with fopen and fwrite
- 5Data Structures in C: Linked Lists, Stacks, and Queues
- 6Multithreading in C: POSIX Threads (Pthreads)
- 7Getting Started with C Programming for Embedded Systems
- 8IoT Applications with C: Beginner’s Guide
- 9Optimizing C Code: Speed and Efficiency
- 10Common C Programming Pitfalls
FAQ'sto learn more about Angular JS.
mail [email protected] to add more queries here 🔍.
- 1
what can you do with c programming
- 2
why was the c programming language invented
- 3
where to download c programming language
- 4
which app is best for c programming in laptop
- 5
how c programming language was developed
- 6
how many days need to learn c programming
- 7
do you pronounce the c in schedule
- 8
which software is best for c programming
- 9
when was c programming language invented
- 10
what is c times c
- 11
what are arrays in c programming
- 13
who is the father of c language mcq
- 14
will c be replaced
- 15
was c written in assembly
- 16
what c programming is used for
- 17
how to do c programming in visual studio code
- 18
why c programming is called structured programming
- 19
which compiler is best for c programming
- 20
what c programming language is used for
- 21
will c++ ever die
- 22
is c programming language object oriented
- 23
when did c programming language come out
- 24
is c programming language case sensitive
- 25
why should i learn c programming language
- 26
why c programming is used
- 27
what is array in c programming
- 28
what can c programming be used for
- 29
who is the programming language c
- 30
which software is used for c programming
- 31
when c is called structured programming language
- 32
why c programming is called c
- 33
is c the first programming language
- 34
who developed c programming language
- 35
why should i learn c programming
- 36
who is the father of c programming
- 37
when c programming was developed
- 38
is c programming language
- 39
is c programming the same as c++
- 40
when was the c programming language developed
- 41
how to do c programming in mobile
- 42
how long will it take to learn c programming
- 43
who is the founder of c programming
- 45
how to use vs code for c programming
- 46
will c ever be replaced
- 47
who invented c programming
- 48
who uses c programming language
- 49
what does c programming look like
- 50
which is the best website to learn c programming
- 51
is c programming language still used
- 52
what are pointers in c programming
- 53
what is structure in c programming
- 54
who created c programming language
- 55
should i learn c programming first
- 56
who wrote c programming language
- 57
who made c programming language
- 58
what can c be used for
- 59
what are variables in c programming
- 60
how difficult is c programming
- 61
can c code run in c++
- 62
what are strings in c programming
- 63
who is the father of c
- 64
where to practice c programming
- 65
how c programming language works
- 66
is c programming hard
- 67
what is string in c programming
- 68
is c dead programming language
- 69
where to start c programming
- 70
what are structures in c programming
- 71
how c programming works
- 72
which book is best for c programming
- 73
what does c programming language look like
- 74
what did == mean in c programming
- 75
will c# replace c++
- 76
how to do c programming in laptop
- 77
where to learn c programming
- 78
how much time is required to learn c programming
- 79
do c programming online
- 80
is c programming worth learning
- 81
what are c programming languages
- 83
is c written in c
- 84
would i like programming
- 85
where to do c programming
- 86
what is pointer in c programming
- 87
what does c programming do
- 88
do c programming language
- 89
how to learn c programming
- 90
what are the features of c programming language
- 91
which ide is best for c programming
- 92
why c is called structured programming language
- 93
where to do c programming in laptop
- 94
is programming in c hard
- 95
who is the father of c programming language
- 96
whose line is it anyway cw schedule
- 97
is c programming still used
- 98
why c programming language
- 99
how to use code blocks for c programming
- 100
what does mean in c programming
- 101
does c programming have classes
- 102
can computers program themselves
- 103
how to do c programming in windows
- 104
what does c programming stand for
- 105
is c programming free
- 106
what are the data types in c programming
- 107
which programming language should i learn after c
- 108
how to start c programming
- 109
will c language die
- 110
what is an compiler in c programming
- 111
where should we do c programming
- 112
where was c programming invented
- 113
who made the c programming language
- 114
which software for c programming
- 115
where c programming is used
- 116
where can i learn c programming for free
- 117
how to do c programming in vs code
- 118
what is c as a programming language
- 119
does c have object oriented programming
- 120
why is c called a mid-level programming language
- 121
can c++ do everything c can
- 122
where is c programming language used
- 123
how does c programming language work
- 124
what are functions in c programming
- 125
do c programming in terminal
- 126
what are keywords in c programming
- 127
can c and c++ be mixed
- 128
why c programming is important
- 129
how to do c programming in ubuntu
- 130
how to practice c programming
- 131
what is embedded c programming
- 132
is c programming case sensitive
- 133
how long does it take to learn c programming
- 134
who is father of c language
- 135
what c programming language
- 136
why c programming is named as c
- 137
why learn c programming
- 138
when was c programming developed
- 139
is c programming easy
- 140
how does c programming work
- 141
is c good for beginners
- 142
which c programming language to learn
- 143
is c programming easy to learn
- 144
why is c named c
- 145
what does c stand for in programming
- 146
when was c programming language created
- 147
what is function in c programming
- 148
why was c invented
- 149
how to download c programming
- 150
what does void mean in c programming
More Sitesto check out once you're finished browsing here.
https://www.0x3d.site/
0x3d is designed for aggregating information.
https://nodejs.0x3d.site/
NodeJS Online Directory
https://cross-platform.0x3d.site/
Cross Platform Online Directory
https://open-source.0x3d.site/
Open Source Online Directory
https://analytics.0x3d.site/
Analytics Online Directory
https://javascript.0x3d.site/
JavaScript Online Directory
https://golang.0x3d.site/
GoLang Online Directory
https://python.0x3d.site/
Python Online Directory
https://swift.0x3d.site/
Swift Online Directory
https://rust.0x3d.site/
Rust Online Directory
https://scala.0x3d.site/
Scala Online Directory
https://ruby.0x3d.site/
Ruby Online Directory
https://clojure.0x3d.site/
Clojure Online Directory
https://elixir.0x3d.site/
Elixir Online Directory
https://elm.0x3d.site/
Elm Online Directory
https://lua.0x3d.site/
Lua Online Directory
https://c-programming.0x3d.site/
C Programming Online Directory
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
https://r-programming.0x3d.site/
R Programming Online Directory
https://perl.0x3d.site/
Perl Online Directory
https://java.0x3d.site/
Java Online Directory
https://kotlin.0x3d.site/
Kotlin Online Directory
https://php.0x3d.site/
PHP Online Directory
https://react.0x3d.site/
React JS Online Directory
https://angular.0x3d.site/
Angular JS Online Directory