Skip to content

Commit

Permalink
Merge branch 'master' of [email protected]:cwi-swat/rascal.git
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Nov 13, 2012
2 parents 124d075 + 0ce2196 commit 54232e2
Show file tree
Hide file tree
Showing 886 changed files with 4,827 additions and 13,705 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@

Another example that results in an error:
<pre class="screen"><span class="prompt">rascal></span>str x &lt;- {1, 3, 5, 7, 11 };
|stdin:///|(0,27,&lt;1,0>,&lt;1,27>): Expected int, but got str
|stdin:///|(22,2,&lt;1,22>,&lt;1,24>): Expected int, but got str

</pre> Here, the enumerator produces its first integer value, an attempt is made to assign this to variable <code>x</code> that is declared as string,
and an error results.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
int: 3
</pre> Since I is declared as type <code>int</code>, we cannot assign a <code>real</code> value to it:
<pre class="screen"><span class="prompt">rascal></span>I = 3.5;
|stdin:///|(4,4,&lt;1,4>,&lt;1,8>): Expected int, but got real
|stdin:///|(4,3,&lt;1,4>,&lt;1,7>): Expected int, but got real

</pre> <pre class="screen"><span class="prompt">rascal></span>num N = 3;
num: 3
Expand Down
186 changes: 58 additions & 128 deletions src/org/rascalmpl/courses/Rascal/Contents/Contents.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Types:
Function:

Details:
Module Import Program StaticTyping AlgebraicDataType Variable Function Syntaxdefinition Alias Annotation Tag
Module Import Program StaticTyping AlgebraicDataType Variable Function SyntaxDefinition Alias Annotation Tag

Description:
The following concepts are relevant for declarations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@


<div id="Details">
<span class="sectionHead">Details</span> <a href="/Rascal/Declarations/Module/Module.html">Module</a> &#032 <a href="/Rascal/Declarations/Import/Import.html">Import</a> &#032 <a href="/Rascal/Declarations/Program/Program.html">Program</a> &#032 <a href="/Rascal/Declarations/StaticTyping/StaticTyping.html">StaticTyping</a> &#032 <a href="/Rascal/Declarations/AlgebraicDataType/AlgebraicDataType.html">AlgebraicDataType</a> &#032 <a href="/Rascal/Declarations/Variable/Variable.html">Variable</a> &#032 <a href="/Rascal/Declarations/Function/Function.html">Function</a> &#032 <a href="/Rascal/Declarations/Syntaxdefinition/Syntaxdefinition.html">Syntaxdefinition</a> &#032 <a href="/Rascal/Declarations/Alias/Alias.html">Alias</a> &#032 <a href="/Rascal/Declarations/Annotation/Annotation.html">Annotation</a> &#032 <a href="/Rascal/Declarations/Tag/Tag.html">Tag</a> &#032 <a href="/Rascal/Declarations/SyntaxDefinition/SyntaxDefinition.html">SyntaxDefinition</a> &#032
<span class="sectionHead">Details</span> <a href="/Rascal/Declarations/Module/Module.html">Module</a> &#032 <a href="/Rascal/Declarations/Import/Import.html">Import</a> &#032 <a href="/Rascal/Declarations/Program/Program.html">Program</a> &#032 <a href="/Rascal/Declarations/StaticTyping/StaticTyping.html">StaticTyping</a> &#032 <a href="/Rascal/Declarations/AlgebraicDataType/AlgebraicDataType.html">AlgebraicDataType</a> &#032 <a href="/Rascal/Declarations/Variable/Variable.html">Variable</a> &#032 <a href="/Rascal/Declarations/Function/Function.html">Function</a> &#032 <a href="/Rascal/Declarations/SyntaxDefinition/SyntaxDefinition.html">SyntaxDefinition</a> &#032 <a href="/Rascal/Declarations/Alias/Alias.html">Alias</a> &#032 <a href="/Rascal/Declarations/Annotation/Annotation.html">Annotation</a> &#032 <a href="/Rascal/Declarations/Tag/Tag.html">Tag</a> &#032
</div>

<div id="Description">
Expand All @@ -65,11 +65,10 @@
<li><a href="/Rascal/Declarations/AlgebraicDataType/AlgebraicDataType.html">AlgebraicDataType</a>: Define a user-defined type (Algebraic Data Type).</li>
<li><a href="/Rascal/Declarations/Variable/Variable.html">Variable</a>: Declare a variable.</li>
<li><a href="/Rascal/Declarations/Function/Function.html">Function</a>: Declare a function.</li>
<li><a href="/Rascal/Declarations/Syntaxdefinition/Syntaxdefinition.html">Syntaxdefinition</a>: Syntax Definitions allow the definition of parsers for programming languages, domain-specific languages and data formats.</li>
<li><a href="/Rascal/Declarations/SyntaxDefinition/SyntaxDefinition.html">SyntaxDefinition</a>: Syntax Definitions allow the definition of parsers for programming languages, domain-specific languages and data formats.</li>
<li><a href="/Rascal/Declarations/Alias/Alias.html">Alias</a>: Declare an alias for a type.</li>
<li><a href="/Rascal/Declarations/Annotation/Annotation.html">Annotation</a>: Declare an annotation type for nodes.</li>
<li><a href="/Rascal/Declarations/Tag/Tag.html">Tag</a>: </li>
<li><a href="/Rascal/Declarations/SyntaxDefinition/SyntaxDefinition.html">SyntaxDefinition</a>: Syntax Definitions allow the definition of parsers for programming languages, domain-specific languages and data formats.</li>
</ul>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,21 +199,20 @@
| amb(set[Tree] alternatives)
| char(int character)
;
data Tree
= error(Production prod, list[Tree] args, list[Tree] rest) <img src="/images/2.png">
| expected(Symbol symbol)
| erroramb(set[Tree] alternatives)
| errorcycle(Symbol symbol, int cycleLength)
;

data Production
= prod(Symbol def, list[Symbol] symbols, set[Attr] attributes) <img src="/images/3.png">
| regular(Symbol def)
| error(Production prod, int dot)
| skipped()
;

data Attr
= \assoc(Associativity \assoc) <img src="/images/4.png">
| \bracket()
| \bracket()
| \tag(value \tag)
;

data Associativity
= \left() <img src="/images/5.png">
| \right()
Expand Down Expand Up @@ -292,11 +291,15 @@
| \reference(Symbol def, str cons)
;

@doc{Nested priority is flattened}
@doc{
Synopsis: Nested priority is flattened.
}
public Production priority(Symbol s, [list[Production] a, priority(Symbol t, list[Production] b),list[Production] c])
= priority(s,a+b+c);

@doc{Choice under associativity is flattened}
@doc{
Synopsis: Choice under associativity is flattened.
}
public Production associativity(Symbol s, Associativity as, {set[Production] a, choice(Symbol t, set[Production] b)})
= associativity(s, as, a+b);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Examples:
<screen>
//Examples of `datetime` values are:
$2010-07-15;
$T09:15:23.123;
$T07:15:23.123+0100;
// Now introduce a `datetime` value and assign it to `DT`.
DT = $2010-07-15T09:15:23.123+03:00;
// Here are examples of some `datatime` fields:
Expand All @@ -94,4 +94,3 @@ In normal parlance, the year 2010 is in the 21th century.
The `century` field, however, just returns the century component of a given year, e.g., for 2010 this is 20.

Questions:

Original file line number Diff line number Diff line change
Expand Up @@ -164,140 +164,8 @@
<span class="sectionHead">Examples</span> Examples of <code>datetime</code> values are:
<pre class="screen"><span class="prompt">rascal></span>$2010-07-15;
datetime: $2010-07-15
<span class="prompt">rascal></span>$T09:15:23.123;
org.eclipse.imp.pdb.facts.exceptions.FactParseError: Error reading time, expected '+' or '-', found: -1(internal error) somewhere in: markupScreen
somewhere in: markup
somewhere in: markup
somewhere in: compileConcept
somewhere in: compileCourse
somewhere in: compile
somewhere in: ___TUTOR___
org.eclipse.imp.pdb.facts.exceptions.FactParseError: Error reading time, expected '+' or '-', found: -1
at org.eclipse.imp.pdb.facts.io.StandardTextReader.readTime(StandardTextReader.java:491)
at org.eclipse.imp.pdb.facts.io.StandardTextReader.readDateTime(StandardTextReader.java:530)
at org.eclipse.imp.pdb.facts.io.StandardTextReader.readValue(StandardTextReader.java:122)
at org.eclipse.imp.pdb.facts.io.StandardTextReader.read(StandardTextReader.java:88)
at org.eclipse.imp.pdb.facts.io.AbstractTextReader.read(AbstractTextReader.java:24)
at org.rascalmpl.semantics.dynamic.JustTime$Lexical.createVisitedTime(JustTime.java:47)
at org.rascalmpl.semantics.dynamic.JustTime$Lexical.interpret(JustTime.java:39)
at org.rascalmpl.semantics.dynamic.DateTimeLiteral$TimeLiteral.interpret(DateTimeLiteral.java:63)
at org.rascalmpl.semantics.dynamic.Literal$DateTime.interpret(Literal.java:83)
at org.rascalmpl.semantics.dynamic.Expression$Literal.interpret(Expression.java:1412)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:351)
at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:781)
at org.rascalmpl.semantics.dynamic.Command$Statement.interpret(Command.java:115)
at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:1000)
at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:865)
at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:815)
at org.rascalmpl.tutor.HTMLGenerator.eval(HTMLGenerator.java:183)
at org.rascalmpl.tutor.HTMLGenerator.shell(HTMLGenerator.java:117)
at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.rascalmpl.interpreter.result.JavaMethod.invoke(JavaMethod.java:134)
at org.rascalmpl.interpreter.result.JavaMethod.call(JavaMethod.java:108)
at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:279)
at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:255)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:442)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:351)
at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:194)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:747)
at org.rascalmpl.semantics.dynamic.Statement$Try.evalStatementTry(Statement.java:929)
at org.rascalmpl.semantics.dynamic.Statement$Try.interpret(Statement.java:922)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:747)
at org.rascalmpl.semantics.dynamic.Statement$While.interpret(Statement.java:1080)
at org.rascalmpl.semantics.dynamic.Statement$Try.evalStatementTry(Statement.java:929)
at org.rascalmpl.semantics.dynamic.Statement$TryFinally.interpret(Statement.java:974)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:415)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:364)
at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:279)
at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:255)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:442)
at org.rascalmpl.semantics.dynamic.Expression$Tuple.interpret(Expression.java:2348)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:351)
at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:771)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:747)
at org.rascalmpl.interpreter.Evaluator.matchAndEval(Evaluator.java:1633)
at org.rascalmpl.interpreter.utils.Cases$DefaultBlock.matchAndEval(Cases.java:199)
at org.rascalmpl.semantics.dynamic.Statement$Switch.interpret(Statement.java:888)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:415)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:364)
at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:279)
at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:255)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:442)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:351)
at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:194)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:747)
at org.rascalmpl.semantics.dynamic.Statement$While.interpret(Statement.java:1080)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:415)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:364)
at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:279)
at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:255)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:442)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:436)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:351)
at org.rascalmpl.interpreter.StringTemplateConverter<i>Visitor</i>IndentingAppend.interpret(StringTemplateConverter.java:110)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:747)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:747)
at org.rascalmpl.semantics.dynamic.Statement$For.interpret(Statement.java:454)
at org.rascalmpl.semantics.dynamic.Literal$String.interpret(Literal.java:237)
at org.rascalmpl.semantics.dynamic.Expression$Literal.interpret(Expression.java:1412)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:351)
at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:194)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:747)
at org.rascalmpl.semantics.dynamic.Statement$Try.evalStatementTry(Statement.java:929)
at org.rascalmpl.semantics.dynamic.Statement$Try.interpret(Statement.java:922)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:415)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:364)
at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:279)
at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:255)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:442)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:351)
at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:194)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:747)
at org.rascalmpl.semantics.dynamic.Statement$Try.evalStatementTry(Statement.java:929)
at org.rascalmpl.semantics.dynamic.Statement$Try.interpret(Statement.java:922)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:747)
at org.rascalmpl.semantics.dynamic.Statement$For.interpret(Statement.java:454)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:415)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:364)
at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:279)
at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:255)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:442)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:351)
at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:194)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:747)
at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:667)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:415)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:364)
at org.rascalmpl.interpreter.result.OverloadedFunction.callWith(OverloadedFunction.java:279)
at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:255)
at org.rascalmpl.interpreter.result.OverloadedFunction.call(OverloadedFunction.java:246)
at org.rascalmpl.interpreter.Evaluator.call(Evaluator.java:483)
at org.rascalmpl.tutor.Compile.doGet(Compile.java:40)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:481)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:940)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:874)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:349)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:904)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:565)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:46)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
at java.lang.Thread.run(Thread.java:680)

<span class="prompt">rascal></span>$T07:15:23.123+0100;
datetime: $T07:15:23.123+0100
</pre> Now introduce a <code>datetime</code> value and assign it to <code>DT</code>.
<pre class="screen"><span class="prompt">rascal></span>DT = $2010-07-15T09:15:23.123+03:00;
datetime: $2010-07-15T08:15:23.123+0200
Expand Down Expand Up @@ -325,7 +193,7 @@
<a id="tutorAction" href="/index.html"><img id="leftIcon" height="40" width="40" src="/images/rascal-tutor-small.png"></a><div id="editMenu">[<a id="editAction" href="/edit?concept=Rascal/Expressions/Values/DateTime&new=false"><b>Edit</b></a>] |
[<a id="newAction" href="/edit?concept=Rascal/Expressions/Values/DateTime&new=true"><b>New Subconcept</b></a>] |
[<a id="compileAction" href="/compile?name=Rascal"><b>Recompile Course</b></a>] |
[<a id="warnAction" href="/Rascal/warnings.html"><b>Warnings</b></a>]<span class="inlineError"> 1 warning in this concept</span></div>
[<a id="warnAction" href="/Rascal/warnings.html"><b>Warnings</b></a>]<span class="inlineError"> 2 warnings in this concept</span></div>
<span class="editMenuFooter">Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit <a href="http://ask.rascal-mpl.org">ask.rascal-mpl.org</a>. </span>
</div>
</td></tr></table>
Expand Down
Loading

0 comments on commit 54232e2

Please sign in to comment.