Understanding C++ Expression Templates - Angelika Langer
Understanding C++ Expression Templates - Angelika Langer
Understanding C++ Expression Templates - Angelika Langer
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
21Example: Arithmetic <strong>Expression</strong>sSyntaxTree:– the representation of an arithmetic expression such as(a+1)*c or log(abs(x-N))Terminal:– a numerical literal such as a constant of type double– a reference to a variable of type double;its value might change between interpretations of theexpressionNonTerminal:– unary and binary expression consisting of one or twosubexpressions;– the expressions have different semantics such as +, -, *, /, ++, --, exp, log, sqrt© Copyright 1995-2000 by <strong>Angelika</strong> <strong>Langer</strong>. All Rights Reserved.http://www.<strong>Angelika</strong><strong>Langer</strong>.com(41)last update: 11/7/2005 ,21:37A Sample Syntax TreeNonTerminal(Binary: Product)(x+2)*3NonTerminal(Binary: Sum)Terminal(Literal: 3)Terminal(Variable: x)Terminal(Literal: 2)© Copyright 1995-2000 by <strong>Angelika</strong> <strong>Langer</strong>. All Rights Reserved.http://www.<strong>Angelika</strong><strong>Langer</strong>.com(42)last update: 11/7/2005 ,21:37