Commit Graph

37 Commits

Author SHA1 Message Date
acqn 624e5025b0 Fixed parsing wide char constants. 2022-08-17 22:28:00 +08:00
acqn 5cca1e8b1d Fixed parsing numeric constants. 2022-08-11 10:55:16 +08:00
acqn 4bb4f033ea Fixed the bug that C keywords were not simply recognized as identifiers in preprocessing. 2022-08-07 16:14:45 +08:00
acqn 7a139a800e Added # and ## as punctuators recognized by the tokenizer.
Reorganized the token enum.
2022-08-06 18:45:49 +08:00
acqn 251e984ba8 Fixed error recovery with preprocessing directives failures. 2022-08-05 14:03:51 +08:00
acqn 9cea9ce5e2 Made the code more constness-correct with 'Type' usage. 2021-04-19 15:36:55 +02:00
Jesse Rosenstock 3df6c383c0 Add support for static_assert
Add C11's _Static_assert and static_assert macro.

This is like #error, but is handled at a later stage
of translation, so it is possible to check sizes of
types, values of enums, etc.

https://en.cppreference.com/w/c/language/_Static_assert
https://port70.net/~nsz/c/c11/n1570.html#6.7.10
2020-07-30 19:17:11 +02:00
Greg King 0390c34e88 Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
2014-06-30 16:51:07 -04:00
Oliver Schmidt 4185caf855 Normalized code. 2014-03-04 01:11:19 +01:00
Oliver Schmidt 85885001b1 Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
uz 4299e2db05 Added the cdecl keyword
git-svn-id: svn://svn.cc65.org/cc65/trunk@4639 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-04-09 19:47:33 +00:00
uz 3976746735 Rewrote literal handling. Literals are now saved together with other function
data, and at the end of compilation merged if possible. Literals for unused
functions are removed together with the function.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4501 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-05 22:39:45 +00:00
uz b5db4cd5fa Added wide char literals, but treat them identical as normal strings.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4185 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-18 14:28:52 +00:00
uz 0b4f6426e2 Some more floating point support.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3886 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-11 17:51:00 +00:00
cuz f196e7c5c9 Cleanup. Added a few general purpose functions.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3710 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-19 15:53:11 +00:00
cuz de3a20a898 Changed the low level type representation from a strung of unsigned short
elements to a string of structs, each representing one type element. This
should fix problems on unusual architectures, since it is no longer necessary
to embedd pointers and other data converted to numbers in the string of
unsigned shorts.
Increased the TypeCode length to unsigned long to make room for more type
bits.
Inline more functions in datatype.h.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3709 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-19 12:29:37 +00:00
cuz 31d99b4a9f Added the inline keyword
git-svn-id: svn://svn.cc65.org/cc65/trunk@3707 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-17 20:27:51 +00:00
cuz 64921852dd Parse the C99 "restrict" keyword correctly (but ignore it otherwise).
git-svn-id: svn://svn.cc65.org/cc65/trunk@3706 b7a2c559-68d2-44c3-8de9-860c34a00d81
2006-02-17 20:19:35 +00:00
cuz 06b57e6e7e Introduce a -E flag that activates just the preprocessor.
Use variable sized string buffers for input and macro processing instead
of the fixed buffers used before.
Many changes in the preprocessor to make it more standards compliant (which
it is still not).


git-svn-id: svn://svn.cc65.org/cc65/trunk@3182 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-09-16 12:42:41 +00:00
cuz fedb566ff1 Some renaming and restructuring
git-svn-id: svn://svn.cc65.org/cc65/trunk@3050 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-05-26 16:15:28 +00:00
cuz 878e4f1352 Changed the expression parser to return the lvalue flag as part of the
ExprDesc structure, not as separate value.
WARNING: The current code does compile but does not work correctly, because
the lvalue flag is part of ExprDesc.Flags and not masked out in several tests
throughout the code.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3046 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-05-25 20:59:38 +00:00
cuz f08179d6af Added the near keyword
git-svn-id: svn://svn.cc65.org/cc65/trunk@2237 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-01 21:38:54 +00:00
cuz 8c62f6b417 The type "enum x" was not handled correctly in sizeof statements and casts.
git-svn-id: svn://svn.cc65.org/cc65/trunk@2235 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-01 21:29:42 +00:00
cuz 0a1266e59b Added the restrict keyword just to have it reserved
git-svn-id: svn://svn.cc65.org/cc65/trunk@2153 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-05-07 21:06:42 +00:00
cuz ea50befaac Redoing the pragma stuff
git-svn-id: svn://svn.cc65.org/cc65/trunk@1413 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-09-29 21:09:47 +00:00
cuz 23fbf3ff2a Adding functionality to StrBuf
git-svn-id: svn://svn.cc65.org/cc65/trunk@885 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-09-09 20:49:20 +00:00
cuz 0e80187cec Added the lineinfo module. Changed the complete code generation to use the
supplied data structures. Re-added the -T option which is much more exact
now because of the better line info stuff.
Cleanups in the scanner (remove old #defines).


git-svn-id: svn://svn.cc65.org/cc65/trunk@740 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-05-22 09:32:24 +00:00
cuz 2eab65ad24 Remove the hardcoded limit from the literal pool.
git-svn-id: svn://svn.cc65.org/cc65/trunk@678 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-03-26 21:57:07 +00:00
cuz d341e0ad76 Removed error numbers in favour of literal error messages. The error numbers
were harder to manage, made the code harder to read, and lead no less
verbose messages, since it was effort to add a new message. The new approach
has the drawback that it's more difficult to translate, but this won't
happen anyway.


git-svn-id: svn://svn.cc65.org/cc65/trunk@428 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-11-02 21:22:33 +00:00
cuz 1b4039be3b Initialize translation tables
git-svn-id: svn://svn.cc65.org/cc65/trunk@327 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-09-14 19:26:13 +00:00
cuz 1c14beb82d Working on the new parser
git-svn-id: svn://svn.cc65.org/cc65/trunk@293 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-08-20 19:12:43 +00:00
cuz 7e59a882c5 Working on the new parser
git-svn-id: svn://svn.cc65.org/cc65/trunk@290 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-08-19 21:55:06 +00:00
cuz 2bcb747b58 Added first code for a parse tree implementation.
git-svn-id: svn://svn.cc65.org/cc65/trunk@287 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-08-16 09:10:50 +00:00
cuz 25f5c69efa Reworked type comparison and handling of type qualifiers
git-svn-id: svn://svn.cc65.org/cc65/trunk@285 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-08-14 22:18:26 +00:00
cuz 04ee693c00 Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@91 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-21 21:02:44 +00:00
cuz 9cc25f13b6 Added support for old style (K&R) function declarations.
Several renames for better readibility.
Removed separate struct and enum symbol tables in favour of one tag table.
Check for some more error conditions or dubious constructs.


git-svn-id: svn://svn.cc65.org/cc65/trunk@62 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-06-12 18:31:40 +00:00
uz 53dd513176 This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-05-28 13:40:48 +00:00