aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Factorized [declaration_specifier_no_type].François Pottier2015-10-231-3/+7
| | | | This saves a few states.
* Added a phantom parameter to [declaration].François Pottier2015-10-231-13/+18
| | | | | | | | | | | This parameter is passed down in [declaration_specifiers(declaration(phantom))]. This allows us to distinguish between three calling contexts for [declaration_specifiers]: - we are definitely in a parameter declaration; - we are definitely in a declaration (e.g., in a block); - we are in a declaration or in a function definition (i.e., at the top level). This allows us to give better error messages. For instance, when inside a block, we know that this cannot be the beginning of a function definition.
* Added a phantom parameter to [declaration_specifiers].François Pottier2015-10-231-7/+11
| | | | | | | | This does not change the automaton at all. It allows us to distinguish more easily between two contexts: - the beginning of a declaration or function definition; - the beginning of a parameter declaration. This leads to better error messages.
* Added a phantom parameter to [abstract_declarator].François Pottier2015-10-231-4/+8
| | | | | | | This allows distinguishing two uses of abstract_declarator, within a type_name and within a parameter_declaration. This provides more static context and allows giving a better syntax error message, as this allows us know what is expected next: a closing parenthesis or a comma.
* Added a phantom parameter to [specifier_qualifier_list].François Pottier2015-10-231-3/+4
|
* A general comment about phantom parameters.François Pottier2015-10-231-0/+16
|
* Remove all productions that involve the [error] token.François Pottier2015-10-231-34/+0
| | | | | These productions were used to give better error messages in some situations. They are no longer useful, since we are building a whole new system for reporting errors.
* Added [Cerrors.fatal_error_raw].François Pottier2015-10-232-0/+13
|
* A .gitignore entry.François Pottier2015-10-231-0/+1
|
* Read the whole source C file into memory instad of reading it on demand.François Pottier2015-10-232-5/+17
| | | | | Having the file in memory will help build an error message. Also, this may be slightly faster.
* Makefile.extr: [make clean] removes .automaton files.François Pottier2015-10-231-0/+1
|
* Switch to --table mode. This is slightly slower but otherwise changes nothing.François Pottier2015-10-231-1/+1
|
* Distinguish [MENHIR] and [MENHIR_MODE]. Cleaner, more flexible.François Pottier2015-10-231-5/+9
|
* Fix [Lexer.char_literal] and [Lexer.string_literal] to properly keep track ↵François Pottier2015-10-221-10/+12
| | | | | | of [lex_start_p]. This is required for Menhir to pick up the correct start position of the token.
* It is probably more efficient to eagerly evaluate $(MENHIR_INCLUDES).François Pottier2015-10-161-1/+1
| | | | This should save a lot of calls to the shell, menhir, and ocamlfind.
* Added [Makefile.menhir], which gives a choice between Menhir's "code" and ↵François Pottier2015-10-162-7/+77
| | | | | | | | | | "table" back-ends when compiling CompCert. For now, MENHIR_TABLE is set to false, so CompCert is not affected. Setting MENHIR_TABLE to true builds CompCert using Menhir's table back-end. This causes a small but repeatable slowdown on "make test", about 2% (roughly 1 second out of 40). I have tested building ccomp and ccomp.byte. I have tested with an ocamlfind-installed menhir and with a manually-installed menhir.
* Replaced 4 uses of [ioption(declaration_specifiers_no_type)] with ↵François Pottier2015-10-081-4/+4
| | | | | | | [declaration_specifiers_no_type?]. Inlining these options was not necessary. This reduces the number of states in the automaton.
* Cosmetic. Removed some spaces. Shared one redundant semantic action {}.François Pottier2015-10-071-7/+6
|
* One cosmetic change of [option] to [?]. No impact.François Pottier2015-10-071-1/+1
|
* Factorized the two forms of FOR statement by introducing [for_statement_header].François Pottier2015-10-071-2/+6
| | | | This leads to a smaller automaton.
* Introduced optional(X, Y), which means X? Y, and used it in array ↵François Pottier2015-10-071-4/+12
| | | | | | declarators and FOR loops. This leads to fewer automaton states, and potentially better error messages.
* Factorized the productions for several categories of binary operators.François Pottier2015-10-071-13/+20
| | | | | | | This leads to a small savings in the number of states (which could become greater in the future if we decide to parameterize expressions). If desired, the old automaton could be recovered by marking the binary operators as %inline.
* Factorized two productions (and two error productions) in [enum_specifier].François Pottier2015-10-071-5/+2
| | | | This is analogous to the previous commit.
* Factorized two productions (and two error productions) in ↵François Pottier2015-10-071-5/+2
| | | | | | | | | | | [struct_or_union_specifier]. The old version was strictly equivalent to using [ioption(other_identifier)]. The new version uses [option(other_identifier)] instead, that is, [other_identifier?]. Technically, this means that [set_id_type i OtherId] is called slightly earlier (at the opening brace, instead of at the closing brace), but this does not make any difference, since the re-classification of identifiers affects only the second parsing phase.
* For clarity, removed several redundant calls to [set_id_type].François Pottier2015-10-071-9/+5
| | | | | | | A TYPEDEF_NAME is already classified as a [TypedefId] by the lexer, and similarly, a VAR_NAME is already classified as a [VarId]. Thus, the removed calls had no effect. The remaining calls to [set_id_type] are useful, as they can re-classify a token.
* Introduced [other_identifier] as a more elegant way of calling [set_id_type ↵François Pottier2015-10-071-19/+22
| | | | | | i OtherId]. This causes no change in the automaton.
* One more replacement of [ioption] with [option].François Pottier2015-10-071-1/+1
| | | | I missed this opportunity in the previous commit.
* Use [option] as much as possible and [ioption] only where necessary.François Pottier2015-10-071-13/+30
| | | | | | | | | The existing [option(X)] was marked %inline, and has been renamed [ioption(X)]. A new [option(X)], which is not marked %inline, has been introduced. The grammar now uses [option] everywhere, except where [ioption] is necessary in order to avoid conflicts. This reduces the number of states in the automaton. The number of LR(0) cores drops from 857 to 712.
* Add -la 1 to Menhir's invocation, to see statistics and warnings.François Pottier2015-10-071-1/+1
|
* Add whitespace, for better vertical alignment and better readability.François Pottier2015-10-071-21/+13
| | | | This violates the 80-column width limit, but is really important.
* Pass --no-stdlib and -v to menhir when compiling pre_parser.mly.François Pottier2015-10-072-1/+2
| | | | | | | Passing --no-stdlib ensures that there is no dependency on Menhir's standard library. Passing -v, which is equivalent to --explain --dump, requests the generation of pre_parser.automaton, a description of the automaton.
* Handle the special case of a typedef to void funciton parameter to beBernhard Schommer2015-10-051-2/+2
| | | | handled as a function with void parameter.
* Merge branch 'master' of github.com:AbsInt/CompCertBernhard Schommer2015-10-0411-24/+83
|\
| * Fixed minor typos in the comments.Bernhard Schommer2015-10-042-2/+2
| |
| * Ensure that there are file directives for all files used in the debugBernhard Schommer2015-10-046-15/+28
| | | | | | | | information.
| * Allow redefinition of a typedef with the same name.Bernhard Schommer2015-10-043-7/+53
| | | | | | | | | | C11 allows a typedef redefinition if the types are the same. We now allow this also and issue a warning and an error if the types are different.
* | Activate the advanced debug for the gcc build.Bernhard Schommer2015-10-031-1/+2
|/
* Add the forgotten Fileinfo also to arm and ia32 TargetPrinter.mlBernhard Schommer2015-10-022-0/+2
|
* Use rev_map so that the debug locations are in the correct order.Bernhard Schommer2015-10-021-1/+1
|
* Merge branch 'gnu-debug'Bernhard Schommer2015-10-0211-149/+255
|\ | | | | | | | | Conflicts: debug/DebugInformation.ml
| * First try of debug information for gcc.Bernhard Schommer2015-10-0211-106/+195
| |
| * Started implementation of gnu compatible debug information.Bernhard Schommer2015-10-024-48/+65
| |
* | Quote the section names in the json files.Bernhard Schommer2015-10-021-1/+1
| |
* | Add also all files for local variables.Bernhard Schommer2015-10-021-0/+1
| |
* | Always call print debug_section in the prologue.Bernhard Schommer2015-10-022-19/+19
|/ | | | | Since files without function definition contain no function in the Section_text the filenum would be empty otherwise.
* Moved the types defined by the Debug Interface into a separate file.Bernhard Schommer2015-10-013-146/+163
|
* Cleanup of now no longer needed functions.Bernhard Schommer2015-10-016-51/+1
|
* Merge pull request #57 from jhjourdan/parser_fixBernhard Schommer2015-10-018-161/+403
|\ | | | | Correction of a few bugs in the pre-parser, added comments.
| * Fixed a few bugs in the pre parser. In particular, the following codeJacques-Henri Jourdan2015-09-308-161/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | was not parsed correctly: typedef int a; int f() { for(int a; ;) if(1); a * x; } Additionnaly, I tried to add some comments in the pre-parser code, especially for the different hacks used to solve various conflicts.
* | Removed the debug output for the debug information.Bernhard Schommer2015-10-011-2/+1
| |