YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
|
|
@ -83,53 +83,62 @@ class Expression
|
|||
number => theTop.
|
||||
}
|
||||
|
||||
operatorState : ch
|
||||
[
|
||||
ch =>
|
||||
$40 [ // (
|
||||
^ target newBracket; gotoStarting
|
||||
];
|
||||
! [
|
||||
^ target newToken; append:ch; gotoToken
|
||||
].
|
||||
]
|
||||
singleton operatorState
|
||||
{
|
||||
eval(ch)
|
||||
[
|
||||
ch =>
|
||||
$40 [ // (
|
||||
^ target newBracket; gotoStarting
|
||||
];
|
||||
! [
|
||||
^ target newToken; append:ch; gotoToken
|
||||
].
|
||||
]
|
||||
}
|
||||
|
||||
tokenState : ch
|
||||
[
|
||||
ch =>
|
||||
$41 [ // )
|
||||
^ target closeBracket; gotoToken
|
||||
];
|
||||
$42 [ // *
|
||||
^ target newProduct; gotoOperator
|
||||
];
|
||||
$43 [ // +
|
||||
^ target newSummary; gotoOperator
|
||||
];
|
||||
$45 [ // -
|
||||
^ target newDifference; gotoOperator
|
||||
];
|
||||
$47 [ // /
|
||||
^ target newFraction; gotoOperator
|
||||
];
|
||||
! [
|
||||
^ target append:ch
|
||||
].
|
||||
]
|
||||
singleton tokenState
|
||||
{
|
||||
eval(ch)
|
||||
[
|
||||
ch =>
|
||||
$41 [ // )
|
||||
^ target closeBracket; gotoToken
|
||||
];
|
||||
$42 [ // *
|
||||
^ target newProduct; gotoOperator
|
||||
];
|
||||
$43 [ // +
|
||||
^ target newSummary; gotoOperator
|
||||
];
|
||||
$45 [ // -
|
||||
^ target newDifference; gotoOperator
|
||||
];
|
||||
$47 [ // /
|
||||
^ target newFraction; gotoOperator
|
||||
];
|
||||
! [
|
||||
^ target append:ch
|
||||
].
|
||||
]
|
||||
}
|
||||
|
||||
startState : ch
|
||||
[
|
||||
ch =>
|
||||
$40 [ // (
|
||||
^ target newBracket; gotoStarting
|
||||
];
|
||||
$45 [ // -
|
||||
^ target newToken; append:"0"; newDifference; gotoOperator
|
||||
];
|
||||
! [
|
||||
^ target newToken; append:ch; gotoToken
|
||||
].
|
||||
]
|
||||
singleton startState
|
||||
{
|
||||
eval(ch)
|
||||
[
|
||||
ch =>
|
||||
$40 [ // (
|
||||
^ target newBracket; gotoStarting
|
||||
];
|
||||
$45 [ // -
|
||||
^ target newToken; append:"0"; newDifference; gotoOperator
|
||||
];
|
||||
! [
|
||||
^ target newToken; append:ch; gotoToken
|
||||
].
|
||||
]
|
||||
}
|
||||
|
||||
class Scope
|
||||
{
|
||||
|
|
@ -295,7 +304,7 @@ class Parser
|
|||
]
|
||||
}
|
||||
|
||||
public program =
|
||||
public program
|
||||
[
|
||||
var aText := StringWriter new.
|
||||
var aParser := Parser new.
|
||||
|
|
@ -311,5 +320,5 @@ public program =
|
|||
}.
|
||||
|
||||
aText clear
|
||||
].
|
||||
].
|
||||
]
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue