Input & Output Input & Output
York University CSE 3401 Vida Movahedi
York University‐ CSE 3401‐ V. Movahedi
1
08_IO
Input & Output Input & Output York University CSE 3401 Vida - - PowerPoint PPT Presentation
Input & Output Input & Output York University CSE 3401 Vida Movahedi 1 York University CSE 3401 V. Movahedi 08_IO Overview Overview Read and write terms Read and write terms Read and write characters Reading English
York University‐ CSE 3401‐ V. Movahedi
1
08_IO
York University‐ CSE 3401‐ V. Movahedi
2
08_IO
and success (e=[X/term])
– If X can be matched with term, success. , – If not, fail.
York University‐ CSE 3401‐ V. Movahedi
3
08_IO
York University‐ CSE 3401‐ V. Movahedi 08_IO
4
York University‐ CSE 3401‐ V. Movahedi 08_IO
5
York University‐ CSE 3401‐ V. Movahedi 08_IO
6
1
2 3 ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(nl) 4
4 5 ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(nl) ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(nl)
6 ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐(nl)
York University‐ CSE 3401‐ V. Movahedi 08_IO
7
York University‐ CSE 3401‐ V. Movahedi 08_IO
8
York University‐ CSE 3401‐ V. Movahedi 08_IO
9
York University‐ CSE 3401‐ V. Movahedi 08_IO
10
York University‐ CSE 3401‐ V. Movahedi 08_IO
11
York University‐ CSE 3401‐ V. Movahedi 08_IO
12
York University‐ CSE 3401‐ V. Movahedi 08_IO
13
York University‐ CSE 3401‐ V. Movahedi 08_IO
14
It is the default input stream
It is the default output stream
York University‐ CSE 3401‐ V. Movahedi 08_IO
15
York University‐ CSE 3401‐ V. Movahedi 08_IO
16
input/output stream
argument
York University‐ CSE 3401‐ V. Movahedi 08_IO
17
York University‐ CSE 3401‐ V. Movahedi 08_IO
18
York University‐ CSE 3401‐ V. Movahedi 08_IO
19
York University‐ CSE 3401‐ V. Movahedi 08_IO
20
York University‐ CSE 3401‐ V. Movahedi 08_IO
21
York University‐ CSE 3401‐ V. Movahedi 08_IO
22
York University‐ CSE 3401‐ V. Movahedi 08_IO
23
the precedence
/(b,c))
8/4/4 i (8/4)/4
York University‐ CSE 3401‐ V. Movahedi
24
08_IO
( d ifi ) :‐ op( Precedence, Specifier, Name). For example: :‐ op(1000, xf, myop). (500 f ‘ ’) :‐ op(500, yfx, ‘+’). :‐ op(400, yfx, ‘*’). :‐ op(900, fy, ‘\+’).
an integer between 1 and 1200, lower values, higher priority
th t ’ the operator’s name
specifies position and associativity valid specifiers: fx fy xfx xfy yfx yfy xf yf valid specifiers: fx, fy, xfx, xfy, yfx, yfy, xf, yf
York University‐ CSE 3401‐ V. Movahedi 08_IO
25
precedence of the operator should occur
precedence of the operator should occur p p
York University‐ CSE 3401‐ V. Movahedi 08_IO
26
Argument containing an operator with the same precedence
York University‐ CSE 3401‐ V. Movahedi 08_IO
27
Argument containing an operator with the same precedence
York University‐ CSE 3401‐ V. Movahedi 08_IO
28
York University‐ CSE 3401‐ V. Movahedi 08_IO
29