Changeset 0ed8759 for doc/user


Ignore:
Timestamp:
May 21, 2017, 11:38:21 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
4adbe45
Parents:
917ab04
Message:

second attempt at rewrite of section syntax ambiguites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/user/user.tex

    r917ab04 r0ed8759  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Sun May 21 23:16:45 2017
    14 %% Update Count     : 1817
     13%% Last Modified On : Sun May 21 23:36:42 2017
     14%% Update Count     : 1822
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    48384838In \CFA, there are ambiguous cases with dereference and operator identifiers, \eg ©int *?*?()©, where the string ©*?*?© can be interpreted as:
    48394839\begin{cfa}
    4840 *?§\color{red}\textvisiblespace§*?
    4841 *§\color{red}\textvisiblespace§?*?
    4842 \end{cfa}
    4843 By default, the first interpretation is selected, which does not yield a meaningful string in the language.
     4840*?§\color{red}\textvisiblespace§*?              §\C{// dereference operator, dereference operator}§
     4841*§\color{red}\textvisiblespace§?*?              §\C{// dereference, multiplication operator}§
     4842\end{cfa}
     4843By default, the first interpretation is selected, which does not yield a meaningful parse.
    48444844Therefore, \CFA does a lexical look-ahead for the second case, and backtracks to return the leading unary operator and reparses the trailing operator identifier.
    48454845Otherwise a space is needed between the unary operator and operator identifier to disambiguate this common case.
     
    48514851*?()§\color{red}\textvisiblespace...§(...) ;
    48524852\end{cfa}
    4853 requiring arbitrary whitespace look-ahead for the routine-call parameter list to disambiguate.
     4853requiring arbitrary whitespace look-ahead for the routine-call parameter-list to disambiguate.
    48544854However, the dereference operator \emph{must} have a parameter/argument to dereference ©*?(...)©.
    48554855Hence, always interpreting the string ©*?()© as \lstinline[showspaces=true]@* ?()@ does not preclude any meaningful program.
     
    48604860i?++§\color{red}\textvisiblespace...§(...);
    48614861\end{cfa}
    4862 requiring arbitrary whitespace look-ahead for the routine-call parameter list, even though that interpretation is an incorrect expression (juxtaposed identifiers).
     4862requiring arbitrary whitespace look-ahead for the operator parameter-list, even though that interpretation is an incorrect expression (juxtaposed identifiers).
    48634863Therefore, it is necessary to disambiguate these cases with a space:
    48644864\begin{cfa}
Note: See TracChangeset for help on using the changeset viewer.