Skip to content

Commit

Permalink
Rascal Tutor: fixed lots of misspellings, recompiled
Browse files Browse the repository at this point in the history
  • Loading branch information
grammarware committed Jun 20, 2012
1 parent 033793e commit 87b1236
Show file tree
Hide file tree
Showing 436 changed files with 1,820 additions and 2,011 deletions.
2 changes: 1 addition & 1 deletion src/org/rascalmpl/library/Benchmark.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Synopsis: Measure and report the execution time of name:void-closure pairs
Description:
Given is a map that maps strings (used as label to identify each case) to void-closures that execute the code to be benchmarked.
An optionl `duration` argument can be used to specify the function to perform the actual measurement. By default the function [realTime] is used. A map of labels and durantions is returned.
An optional `duration` argument can be used to specify the function to perform the actual measurement. By default the function [realTime] is used. A map of labels and durations is returned.
Examples:
We use the factorial function described in [Recipes:Factorial] as example:
Expand Down
4 changes: 2 additions & 2 deletions src/org/rascalmpl/library/IO.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public &T iprintExp(&T v) {
}

@doc{
Synopsis: Print an indented representation of a value follwed by a newline and returns the value as result.
Synopsis: Print an indented representation of a value followed by a newline and returns the value as result.

Description:
See [$IO/iprintExp] for a version that does not add a newline.
Expand Down Expand Up @@ -394,7 +394,7 @@ throws UnsupportedScheme(loc file), PathNotFound(loc file), IO(str msg);


@doc{
Synopsis: Read the contens of a file location and return it as a list of strings.
Synopsis: Read the contents of a file location and return it as a list of strings.

Description:
Return the contents of a file location as a list of lines.
Expand Down
6 changes: 3 additions & 3 deletions src/org/rascalmpl/library/List.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public list[int] index(list[&T] lst) = upTill(size(lst));
@doc{
Synopsis: Index of first occurence of an element in a list.
Synopsis: Index of first occurrence of an element in a list.
Description:
Return index of first occurrence of `elt` in `lst`, or `-1` if `elt` is not found.
Expand Down Expand Up @@ -650,7 +650,7 @@ Synopsis: Mix the elements of two lists.
Description:
Let n be the minimum of the length of the two lists `l` and `r`.
`mix` returns a list in which the first `n` elements are taken alternatingly from the left and the right list,
`mix` returns a list in which the first `n` elements are taken alternately from the left and the right list,
followed by the remaining elements of the longest list.
Examples:
Expand Down Expand Up @@ -727,7 +727,7 @@ public &T last(list[&T] lst) throws EmptyList {
}
@doc{
Synopsis: Return index of last occurence of elt in lst, or -1 if elt is not found.
Synopsis: Return index of last occurrence of elt in lst, or -1 if elt is not found.
Description:
Also see [$List/indexOf].
Expand Down
4 changes: 2 additions & 2 deletions src/org/rascalmpl/library/ParseTree.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Description:
* The `start` symbol (/*8*/) wraps any symbol to indicate that it is a start symbol of the grammar and
may occur at the root of a parse tree.
* `Symbol` defines non-terminals (/*9*/), terminals (/*10*/) and regular expressions (/*11*/).
* The `Conditional` wrapper (/*12*/) adds conditions to the existance of an instance of a symbol.
* The `Conditional` wrapper (/*12*/) adds conditions to the existence of an instance of a symbol.
* A `Condition` (/*13*/) on a symbol gives rise to a disambiguation filter.
}

Expand Down Expand Up @@ -201,7 +201,7 @@ construct ordered and un-ordered compositions, and associativity groups.
The intended semantics are that
* 'choice' means unordered choice (defined in |Type|)
* 'priority' means ordered choice, where alternatives are tried from left to right,
* 'assoc' means all alternatives are acceptible, but nested on the declared side
* 'assoc' means all alternatives are acceptable, but nested on the declared side
* 'others' means '...', which is substituted for a choice among the other definitions
* 'reference' means a reference to another production rule which should be substituted there,
for extending priority chains and such.
Expand Down
2 changes: 1 addition & 1 deletion src/org/rascalmpl/library/SystemAPI.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public java str getSystemProperty(str property);

/*
@doc{Returns content of location <loc> which is assumed a rascal program. The backquotes
will be replaced by stringquotes. And the stringquotes inside them will be escaped.}
will be replaced by string quotes. And the string quotes inside them will be escaped.}
@javaClass{org.rascalmpl.library.util.SystemAPI}
public java str getRascalFileContent(loc g) throws
UnsupportedScheme(loc file), PathNotFound(loc file), IO(str msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Most language concepts are described separately but some features we just mentio
* Rascal programs consist of modules that are organized in packages.
* Modules can import other modules.
* The visibility of entities declared in modules can be controlled using public/private modifiers.
* Datastructures may have annotations that can be explicitly used and modified.
* There is an extensive library for builtin datatypes, input/output, fact extraction from Java source code, visualization, and more.
* Data structures may have annotations that can be explicitly used and modified.
* There is an extensive library for built-in datatypes, input/output, fact extraction from Java source code, visualization, and more.


Here is a brief summary of the concepts to be discussed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
<ul><li> Rascal programs consist of modules that are organized in packages.</li>
<li> Modules can import other modules.</li>
<li> The visibility of entities declared in modules can be controlled using public/private modifiers.</li>
<li> Datastructures may have annotations that can be explicitly used and modified.</li>
<li> There is an extensive library for builtin datatypes, input/output, fact extraction from Java source code, visualization, and more.</li>
<li> Data structures may have annotations that can be explicitly used and modified.</li>
<li> There is an extensive library for built-in datatypes, input/output, fact extraction from Java source code, visualization, and more.</li>
</ul> Here is a brief summary of the concepts to be discussed:
<ul><li><a href="/Courses/Rascal/Concepts/StaticTyping/StaticTyping.html">StaticTyping</a>: Static type checking.</li>
<li><a href="/Courses/Rascal/Concepts/Datatypes/Datatypes.html">Datatypes</a>: Built-in and user-defined datatypes.</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ Rascal provides a rich set of datatypes:

There is a wealth of built-in operators and library functions available on the standard datatypes.

These builtin datatypes are closely related to each other:
These built-in datatypes are closely related to each other:

* In a list all elements have the same static type and the order of elements matters. A list may contain the same value more than once.
* In a set all elements have the same static type and the order of elements does not matter.
A set contains an element only once. In other words, duplicate elements are eliminated
and no matter how many times an element is added to a set, it will occur in it only once.
* In a tuple alle elements (may) have a different static type. Each element of a tuple may have a label that can be used to select that
* In a tuple all elements (may) have a different static type. Each element of a tuple may have a label that can be used to select that
element of the tuple.
* A relation is a set of tuples which all have the same static tuple type.
* A map is an associative table of (key, value) pairs. Key and value (may) have different static
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
<br/>
<br/>

These builtin datatypes are closely related to each other:
These built-in datatypes are closely related to each other:
<ul><li> In a list all elements have the same static type and the order of elements matters. A list may contain the same value more than once.</li>
<li> In a set all elements have the same static type and the order of elements does not matter. A set contains an element only once. In other words, duplicate elements are eliminated
and no matter how many times an element is added to a set, it will occur in it only once.
</li>
<li> In a tuple alle elements (may) have a different static type. Each element of a tuple may have a label that can be used to select that element of the tuple.
<li> In a tuple all elements (may) have a different static type. Each element of a tuple may have a label that can be used to select that element of the tuple.
</li>
<li> A relation is a set of tuples which all have the same static tuple type.</li>
<li> A map is an associative table of (key, value) pairs. Key and value (may) have different static type and a key can only be associated with a value once.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The actual solution (if any) is found by enumerating solutions and testing their
Rascal provides a [Solve] statement that helps writing constraint solvers.

Examples:
A typical example is dataflow analysis where the propagation of values through a program can be described by a set of equations. Their solution can be found with the solve statement. <warning> add links </warning>
A typical example is data flow analysis where the propagation of values through a program can be described by a set of equations. Their solution can be found with the solve statement. <warning> add links </warning>

Benefits:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@


<div id="Examples">
<span class="sectionHead">Examples</span> A typical example is dataflow analysis where the propagation of values through a program can be described by a set of equations. Their solution can be found with the solve statement. <warning> add links </warning>
<span class="sectionHead">Examples</span> A typical example is data flow analysis where the propagation of values through a program can be described by a set of equations. Their solution can be found with the solve statement. <warning> add links </warning>

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ At /*2*/ a default for `simp` is given: if no other definition applies, the defa
At /*3*/ the actual `simplify` function is given: it performs a bottom up visit of the expression, replacing each subexpression by
a simplified version.

See [Recipes:derivative] for a full explantion of this example.
See [Recipes:derivative] for a full explanation of this example.

Benefits:

Pitfalls:
Rascal does still have special syntax for rewrite rules, but this has been __deprecated__ in favour of pattern-directed invocation that can achieve the same, see [Function].

The above example can be written ussing rule notation:
The above example can be written using rule notation:

<listing>
rule simp1 product(con(1), Expression e) => e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<br/>
<br/>

See <a href="/Courses/Recipes/Common/Derivative/Derivative.html">Recipes:derivative</a> for a full explantion of this example.
See <a href="/Courses/Recipes/Common/Derivative/Derivative.html">Recipes:derivative</a> for a full explanation of this example.

</div>

Expand All @@ -114,7 +114,7 @@
<br/>
<br/>

The above example can be written ussing rule notation:
The above example can be written using rule notation:
<pre class="listing">rule simp1 product(con(1), Expression e) => e;
rule simp2 product(Expression e, con(1)) => e;
rule simp3 product(con(0), Expression e) => con(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Function:
Details:

Description:
Visiting the elements of a datastructure is one of the most common operations in our domain
Visiting the elements of a data structure is one of the most common operations in our domain
and the visitor design pattern is a solution known to every software engineer.
Given a tree-like datastructure we want to perform an operation on some (or all) nodes of the tree. The purpose of the visitor design pattern is to decouple the logistics of visiting each node from the actual operation on each node. In Rascal the logistics of visiting is completely automated.
Given a tree-like data structure we want to perform an operation on some (or all) nodes of the tree. The purpose of the visitor design pattern is to decouple the logistics of visiting each node from the actual operation on each node. In Rascal the logistics of visiting is completely automated.

Visiting is achieved by way of visit expressions that resemble the switch statement. A visit expressions traverses an arbitrarily complex subject value and applies a number of cases to all its subtrees.
All the elements of the subject are visited and when one of the cases matches the statements associated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@


<div id="Description">
<span class="sectionHead">Description</span> Visiting the elements of a datastructure is one of the most common operations in our domain
<span class="sectionHead">Description</span> Visiting the elements of a data structure is one of the most common operations in our domain
and the visitor design pattern is a solution known to every software engineer.
Given a tree-like datastructure we want to perform an operation on some (or all) nodes of the tree. The purpose of the visitor design pattern is to decouple the logistics of visiting each node from the actual operation on each node. In Rascal the logistics of visiting is completely automated.
Given a tree-like data structure we want to perform an operation on some (or all) nodes of the tree. The purpose of the visitor design pattern is to decouple the logistics of visiting each node from the actual operation on each node. In Rascal the logistics of visiting is completely automated.
<br/>
<br/>

Expand Down
Loading

0 comments on commit 87b1236

Please sign in to comment.