Changeset 93d0ed3


Ignore:
Timestamp:
Aug 12, 2021, 8:46:58 AM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c9f9d4f
Parents:
bfd7b30
Message:

fix problem in virtual type examples and figure

Location:
doc/theses/andrew_beach_MMath
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/features.tex

    rbfd7b30 r93d0ed3  
    165165% The root type has no ancestors.
    166166% A type's descendants are its children and its children's descendants.
    167 Every virtual type also has a pointer to a virtual table with list of virtual members. Children inherit
    168 their parent's list of virtual members but may add new members to it.
    169 For example,
     167Every virtual type (tree node) has a pointer to a virtual table with a unique
     168@Id@ and a list of virtual members (see \autoref{s:VirtualSystem} for
     169details). Children inherit their parent's list of virtual members but may add
     170and/or replace members.  For example,
    170171\begin{cfa}
    171172vtable W0 | { int ?<?( int, int ); int ?+?( int, int ); }
    172 vtable W1 | { int w, int ?==?( int, int ); int ?-?( int, int ); }
     173vtable W1 | { int ?+?( int, int ); int w, int ?-?( int, int ); }
    173174\end{cfa}
    174175creates a virtual table for @W0@ initialized with the matching @<@ and @+@
    175 operations visible at this declaration.  Similarly, @W1@ is initialized with
    176 @<@ and @+@ from the inheritance with @W0@, plus the @==@ and @-@ operations
    177 visible at this declaration. It is important to note that these are virtual
    178 members, not virtual methods of object-orientated programming, and can be of
    179 any type.
     176operations visible at this declaration context.  Similarly, @W1@ is initialized
     177with @<@ from inheritance with @W0@, @+@ is replaced, and @-@ is added, where
     178both operations are matched at this declaration context. It is important to
     179note that these are virtual members, not virtual methods of object-orientated
     180programming, and can be of any type. Finally, trait names can be used to
     181specify the list of virtual members.
    180182
    181183\PAB{Need to look at these when done.
     
    187189as if it were a method.
    188190\todo{Clarify (with an example) virtual methods.}
    189 
    190 Each virtual type has a unique id.
    191 This id and all the virtual members are combined
    192 into a virtual table type. Each virtual type has a pointer to a virtual table
    193 as a hidden field.
    194 \todo{Might need a diagram for virtual structure.}
    195191}%
    196192
  • doc/theses/andrew_beach_MMath/vtable.fig

    rbfd7b30 r93d0ed3  
    39394 0 0 50 -1 0 11 0.0000 2 135 420 2880 2070 vtable\001
    40404 1 0 50 -1 0 12 0.0000 2 180 1365 1935 1080 virtual type trees\001
    41 4 0 0 50 -1 5 11 0.0000 2 120 315 3060 1755 <,+\001
    42 4 0 0 50 -1 5 11 0.0000 2 120 1050 3060 2250 <,+,w,==,-\001
     414 0 0 50 -1 5 11 0.0000 2 150 735 3060 1755 Id; <,+\001
     424 0 0 50 -1 5 11 0.0000 2 150 1155 3060 2250 Id; <,+,w,-\001
Note: See TracChangeset for help on using the changeset viewer.