[gogc] 2 new revisions pushed by bytbox on 2010-08-18 01:03 GMT

0 views
Skip to first unread message

go...@googlecode.com

unread,
Aug 18, 2010, 12:07:59 AM8/18/10
to go...@googlegroups.com
2 new revisions:

Revision: d9b8a838c5
Author: Michael Lippautz <michael....@gmail.com>
Date: Thu Jul 1 11:17:23 2010
Log: documentation: Switch to Makefile approach
http://code.google.com/p/gogc/source/detail?r=d9b8a838c5

Revision: 4f7ba4ba18
Author: Michael Lippautz <michael....@gmail.com>
Date: Thu Jul 1 12:05:55 2010
Log: documentation: Start scanner/parser chapter and modify tables
http://code.google.com/p/gogc/source/detail?r=4f7ba4ba18

==============================================================================
Revision: d9b8a838c5
Author: Michael Lippautz <michael....@gmail.com>
Date: Thu Jul 1 11:17:23 2010
Log: documentation: Switch to Makefile approach
http://code.google.com/p/gogc/source/detail?r=d9b8a838c5

Added:
/docs/latex/Makefile
Deleted:
/docs/latex/clean
/docs/latex/rebuild
Modified:
/docs/latex/gogo.pdf

=======================================
--- /dev/null
+++ /docs/latex/Makefile Thu Jul 1 11:17:23 2010
@@ -0,0 +1,8 @@
+all:
+ pdflatex gogo.tex
+ bibtex gogo
+ pdflatex gogo.tex
+ pdflatex gogo.tex
+
+clean:
+ rm -rf *.bbl *.log *.toc *.aux *.out *.blg
=======================================
--- /docs/latex/clean Thu Jul 1 11:07:47 2010
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-rm -rf *.bbl *.log *.toc *.aux *.out *.blg
=======================================
--- /docs/latex/rebuild Fri Jun 4 02:57:09 2010
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-pdflatex gogo.tex
-bibtex gogo
-pdflatex gogo.tex
-pdflatex gogo.tex
=======================================
--- /docs/latex/gogo.pdf Thu Jul 1 11:07:47 2010
+++ /docs/latex/gogo.pdf Thu Jul 1 11:17:23 2010
Binary file, no diff available.

==============================================================================
Revision: 4f7ba4ba18
Author: Michael Lippautz <michael....@gmail.com>
Date: Thu Jul 1 12:05:55 2010
Log: documentation: Start scanner/parser chapter and modify tables
http://code.google.com/p/gogc/source/detail?r=4f7ba4ba18

Modified:
/docs/latex/gogo.pdf
/docs/latex/gogo.tex

=======================================
--- /docs/latex/gogo.pdf Thu Jul 1 11:17:23 2010
+++ /docs/latex/gogo.pdf Thu Jul 1 12:05:55 2010
Binary file, no diff available.
=======================================
--- /docs/latex/gogo.tex Thu Jul 1 11:07:47 2010
+++ /docs/latex/gogo.tex Thu Jul 1 12:05:55 2010
@@ -1,5 +1,6 @@
\documentclass[a4paper]{scrreprt}

+\usepackage{booktabs}
\usepackage[usenames,dvipsnames]{color}
\usepackage[latin1]{inputenc}
\usepackage{listings}
@@ -150,22 +151,58 @@
The assembly output consists basically of three sections: the data
segment, the initialization segment and the code segment. GoGo's assembly
output framework provides basic output routines which make it possible to
switch between those three segments. Whereas the data segment is used to
reserve space for global variables and strings in the data segment, the
initialization segment and the code segment contain the code for global
variable initialization and the functions from the input, respectively. All
other functions (code generation for arithmetical expressions etc.) rely on
the assembly output framework which is also able to place comments with the
corresponding input file name and line number for debugging purposes in the
output file.

\chapter{Scanner / Parser}
- Lorem ipsum dolor sit amet...
+ The scanner is basically the provider of tokens that are used by the
parser
+ to interpret the code. In order to generate these tokens the scanner
reads
+ the file character by character. If a sequence is known, it converts
this
+ sequence of characters into the corresponding token. Tokens generated
this
+ way are called simple tokens, as they can be generated right away. For
+ instance, a sequence \textit{'A'} can be directly converted into a
token
+ representing a byte value. \\
+ Before providing a token to the parser, the scanner may convert such a
+ simple token one more time. These complex tokens are generated from
simple
+ ones that represent identifiers. The identifiers are compared to a
+ predefined list of keywords. If a keyword matches a token value, the
token
+ is converted to the one representing the keyword. Table
\ref{tbl:tokens}
+ lists some of these tokens.
+
+ \begin{table}[htb]
+ \centering
+ \begin{tabular}{ll}
+ \toprule
+ Simple tokens & \&\&, +, -, \{, \}, $($, $)$, \dots \\
+ \midrule
+ Complex tokens & for, if, else, func, type \\
+ \bottomrule
+ \end{tabular}
+ \caption{Token examples}
+ \label{tbl:tokens}
+ \end{table}

\chapter{Symbol table}
In order to be able to lookup local and global variable names as well
as function names, a symbol table is required. Based on \cite{wir96},
object and type descriptors were used, each containing the information
required for lookup and code generation. Object descriptors are used to
store information about variables and parameters whereas type descriptors
are used to store information about types and functions.\\
- The following table summarizes the fields of the object and type
descriptors and their respective purpose. Some fields had to be added in
order to support forward declarations and the distinction between values
and pointers.\\ \\
- \textbf{ObjectDesc:}\\
- \begin{tabular}{|c|c|l|}
- \hline
- \textbf{Field} & \textbf{Type} & \textbf{Purpose}\\ \hline
- Name & \texttt{string} & The object's name\\ \hline
- PackageName & \texttt{string} & The object's package (Go name
space)\\ \hline
- Class & \texttt{uint64} & The descriptors's kind (variable, field,
parameter)\\ \hline
- ObjType & \texttt{*TypeDesc} & The object's type\\ \hline
- PtrType & \texttt{uint64} & If 1, the object's type is
\texttt{*ObjType}; if 0, \texttt{ObjType}\\ \hline
- Next & \texttt{*ObjType} & Next object (linked list)\\ \hline
- \end{tabular}\\ \\
+ The following table \ref{tbl:objectdesc} summarizes the fields of the
object and type descriptors and their respective purpose. Some fields had
to be added in order to support forward declarations and the distinction
between values and pointers.\\ \\
+ \begin{table}[htb]
+ \centering
+ \begin{tabular}{ccl}
+ \toprule
+ \textbf{Field} & \textbf{Type} & \textbf{Purpose}\\
+ \midrule
+ Name & \texttt{string} & The object's name\\
+ \midrule
+ PackageName & \texttt{string} & The object's package (Go name
space)\\
+ \midrule
+ Class & \texttt{uint64} & The descriptors's kind (variable, field,
parameter)\\
+ \midrule
+ ObjType & \texttt{*TypeDesc} & The object's type\\
+ \midrule
+ PtrType & \texttt{uint64} & If 1, the object's type is
\texttt{*ObjType}; if 0, \texttt{ObjType}\\
+ \midrule
+ Next & \texttt{*ObjType} & Next object (linked list)\\
+ \bottomrule
+ \end{tabular}
+ \caption{ObjectDesc}
+ \label{tbl:objectdesc}
+ \end{table}\\ \\
\textbf{TypeDesc:}\\
\begin{tabular}{|c|c|l|}
\hline

Reply all
Reply to author
Forward
0 new messages