Ce diaporama a bien été signalé.
Le téléchargement de votre SlideShare est en cours. ×

2015.01.06 f sharp_intro_milan_kubicek

Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Prochain SlideShare
BDD with F# at DDD9
BDD with F# at DDD9
Chargement dans…3
×

Consultez-les par la suite

1 sur 17 Publicité

Plus De Contenu Connexe

Plus récents (20)

Publicité

2015.01.06 f sharp_intro_milan_kubicek

  1. 1. Parsing F# with PetitParser F# indentation sensitive lightweight syntax 
 
 Milan Kubicek 
 SCG Seminar 
 06.01.2015
  2. 2. some F# code.. 2
  3. 3. 3 ..some nicer F# code Output:
 1: 1 2: 1 3: 2 4: 3 5: 5 6: 8 7: 13 8: 21 9: 34 10: 55
  4. 4. 4 indentation
 as secondary notation indentation
 as formal notation
  5. 5. indentation
 in programming secondary notation 
 / syntactic sugar define structure F# Python Haskell “curly bracket programming languages” 5 “indentation sensitive
 programming languages”
  6. 6. 6 off-side rule off-side on-side off-side line valid pass! foul pass!
  7. 7. 7 off-side rule
  8. 8. 8 off-side rule off-side on-side off-side line
  9. 9. 9 off-side rule
  10. 10. 10 off-side rule exceptions off-side on-side off-side line
  11. 11. 11 off-side rule exceptions “then-&else-body on-side aligned” “then-body aligned” “else-body aligned”
  12. 12. 12 challanges F# language definition (Petit)Parsing knowledge mini F# PetitParser grammar (using PetitIndent)
  13. 13. 13 F# lightweight syntax indentation as primary notation: ..code position changes semantics! off-side on-side off-side line aligned
  14. 14. 14 questions?
  15. 15. 15
  16. 16. – http://en.wikipedia.org/wiki/Secondary_notation 05.01.2015 “…An example of secondary notation is in computer programming, where code is often displayed with positioning, indentation, color and symmetry. This does not affect the behaviour of the program, but it makes it easier to read and understand the code…” 16 secondary notation
  17. 17. –Peter J. Landin, “The Next 700 Programming Languages” “Any non-whitespace token to the left of the first such token on the previous line is taken to be the start of a new declaration.” Off-side rule 17

×