aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2019-01-23 14:55:58 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2019-03-07 21:45:53 +0100
commitf7082a9a7cb26bd6531d6cd25914e4fcc30ab0c3 (patch)
tree9f50de33e8aefbd24cac9011d651bf90177fcf77 /vl.c
parent53167f562693981dbc18fb0071df4667dabdf7b6 (diff)
minikconfig: add semantic analysis
There are three parts in the semantic analysis: 1) evaluating expressions. This is done as a simple visit of the Expr nodes. 2) ordering clauses. This is done by constructing a graph of variables. There is an edge from X to Y if Y depends on X, if X selects Y, or if X appears in a conditional selection of Y; in other words, if the value of X can affect the value of Y. Each clause has a "destination" variable whose value can be affected by the clause, and clauses will be processed according to a topological sorting of their destination variables. Defaults are processed after all other clauses with the same destination. 3) deriving the value of the variables. This is done by processing the clauses in the topological order provided by the previous step. A "depends on" clause will force a variable to False, a "select" clause will force a variable to True, an assignment will force a variable to its RHS. A default will set a variable to its RHS if it has not been set before. Because all variables have a default, after visiting all clauses all variables will have been set. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20190123065618.3520-25-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'vl.c')
0 files changed, 0 insertions, 0 deletions