Skip to content
This repository
tree: 7eeea769d5
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 38 lines (33 sloc) 1.503 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
from "yacc is dead" on ltu at http://lambda-the-ultimate.org/node/4148#comment

"
x*y;

In C++ this could be a multiplication, pointer declaration, or
arbitrary overloaded meaning of "*". You have to hit name and type
resolution before you can distinguish them.
"

(* Cocci: Each token will be decorated in the future by the mcodekind
 * of cocci. It is the job of the pretty printer to look at this
 * information and decide to print or not the token (and also the
 * pending '+' associated sometimes with the token).
 *
 * The first time that we parse the original C file, the mcodekind is
 * empty, or more precisely all is tagged as a CONTEXT with NOTHING
 * associated. This is what I call a "clean" expr/statement/....
 *
 * Each token will also be decorated in the future with an environment,
 * because the pending '+' may contain metavariables that refer to some
 * C code.
 *
 * Update: Now I use a ref! so take care.
 *
 * Sometimes we want to add someting at the beginning or at the end
 * of a construct. For 'function' and 'decl' we want add something
 * to their left and for 'if' 'while' et 'for' and so on at their right.
 * We want some kinds of "virtual placeholders" that represent the start or
 * end of a construct. We use fakeInfo for that purpose.
 * To identify those cases I have added a fakestart/fakeend comment.
 *
 * convention: I often use 'ii' for the name of a list of info.
 *
 *)

http://eli.thegreenplace.net/2007/11/24/the-context-sensitivity-of-cs-grammar/
Something went wrong with that request. Please try again.