CSE 450. Translation of Programming Languages. Lecture 3: Git Setup and More Lexing

Similar documents
Fixture List 2018 FIFA World Cup Preliminary Competition

Cruise Line Agencies of Alaska. Cruise Ship Calendar for 2016 FOR PORT(S) = KTN AND SHIP(S) = ALL AND VOYAGES = ALL

Cruise Line Agencies of Alaska. Cruise Ship Calendar for 2016 FOR PORT(S) = KTN AND SHIP(S) = ALL AND VOYAGES = ALL

Basic Components of an LP:

Cruise Line Agencies of Alaska. Cruise Ship Calendar for 2012 FOR PORT(S) = KTN AND SHIP(S) = ALL AND VOYAGES = ALL

Cruise Line Agencies of Alaska. Cruise Ship Calendar for 2013 FOR PORT(S) = KTN AND SHIP(S) = ALL AND VOYAGES = ALL

Version Control! Scenarios, Working with Git!

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Introduction to Version Control with Git

Strategy Deployment Through Collaborative Planning. Linking the Strategy to Practical Activity

Version control systems. Lecture 2

Compiler Construction

Charts, Tables, and Graphs

A Lex Tutorial. Victor Eijkhout. July Introduction. 2 Structure of a lex file

Adding Integers Using a Number Line

MATLAB & Git Versioning: The Very Basics

Source Code Management for Continuous Integration and Deployment. Version 1.0 DO NOT DISTRIBUTE

TELNET CLIENT 5.11 SSH SUPPORT

Arithmetic Progression

Gitflow process. Adapt Learning: Gitflow process. Document control

Managing Users and Identity Stores

Monday Tuesday Wednesday Thursday Friday Saturday Sunday. Day 4 20-Minute Aerobics Solution. Day 3 Lower Body Weight Training

Lab Exercise Part II: Git: A distributed version control system

DECEMBER 2015 PTAB Public Hearing Schedule

STEP-BY-STEP GUIDE FOR DOCUMENT UPLOAD IN epct (PUBLIC AND PRIVATE SERVICES)

What's a backup cycle?

Sources: On the Web: Slides will be available on:

HIPAA Compliance Use Case

Configuring the Scheduler

Regular Expressions Overview Suppose you needed to find a specific IPv4 address in a bunch of files? This is easy to do; you just specify the IP

Introduction to the Git Version Control System

Version Control Using Subversion. Version Control Using Subversion 1 / 27

Putting It All Together. Vagrant Drush Version Control

Version Control. Version Control

Compilers Lexical Analysis

Binary Adders: Half Adders and Full Adders

Using GitHub for Rally Apps (Mac Version)

1. Data Domain Pre-requisites. 2. Enabling OST

FEEG Applied Programming 3 - Version Control and Git II

Section 1.4 Place Value Systems of Numeration in Other Bases

Rational Exponents. Squaring both sides of the equation yields. and to be consistent, we must have

Introduction to Version Control with Git

here: styleguide.googlecode.com/svn/trunk/javascriptguide.xml.

Mercurial. Why version control (Single users)

KS2 Missing Digits Non-Calculator Level 3/4 Number of practice sheets: 9 MathSphere MathSphere

Network Planning and Analysis

Git - Working with Remote Repositories

Version Control with Git. Linux Users Group UT Arlington. Rohit Rawat

Work. MATLAB Source Control Using Git

Section 8 Scheduler. Alcatel-Lucent OmniVista 4760 Network Management System

CSE 374 Programming Concepts & Tools. Laura Campbell (Thanks to Hal Perkins) Winter 2014 Lecture 16 Version control and svn

Copyright MyPW LLC.

IBM i Version 7.2. Systems management Advanced job scheduler

The Hitchhiker s Guide to Github: SAS Programming Goes Social Jiangtang Hu d-wise Technologies, Inc., Morrisville, NC

GENERATIONS QUICK START GUIDE

Configuring the Watchguard Edge for RADIUS authentication

How to Create a Free Private GitHub Repository Educational Account

Eventia Log Parsing Editor 1.0 Administration Guide

Pemrograman Dasar. Basic Elements Of Java

Working with whole numbers

Programming Languages CIS 443

Chapter 4: Computer Codes

Installation Guides - Information required for connection to the Goldfields Institute s (GIT) Wireless Network

ECAS. ECAS Data Transfer Specification. Issue 3.0. Document No.

Using GhostPorts Two-Factor Authentication

ONLINE COURSE REGISTRATION TUTORIAL

U11 Boys Black March 21st Monday 6:00-7:30 p.m. Damien Training Field 2 March 24th Thursday 4:30-6:00 p.m. Damien Training Field 2 March 28th Monday 6

Working Copy 1.4 users manual

User Starter Guide. Webtop Set up

WebEx Integration to Lotus Notes. Users Guide

C&A AR Online Credit Card Processor Installation and Setup Instructions with Process Flow

Time Entry for TAPFIN Contractors

BIGPOND ONLINE STORAGE USER GUIDE Issue August 2005

Configuring CSS Remote Access Methods

Entrust IdentityGuard Comprehensive

CHAPTER 2: SERVICE MANAGEMENT SETUP

Uploading and Downloading Files to the HIS Server. Application Requirements

Creating a New Domain Tree in the Forest

Eurobackup PRO Exchange Databases Backup Best Practices

EMPLOYMENT APPLICATION {PLEASE Print Clearly}

SourceAnywhere Service Configurator can be launched from Start -> All Programs -> Dynamsoft SourceAnywhere Server.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

MOOSE-Based Application Development on GitLab

Using Windows Task Scheduler instead of the Backup Express Scheduler

HPCC Data Handling. Boca Raton Documentation Team

STABLE & SECURE BANK lab writeup. Page 1 of 21

Version Control Systems

Scanner. tokens scanner parser IR. source code. errors

Financial Mathematics

Introducing Xcode Source Control

Version control with GIT

Version Control with Git

You are ready to register for credit courses

Tera Term Telnet. Introduction

How do I Install and Configure MS Remote Desktop for the Haas Terminal Server on my Mac?

Video Administration Backup and Restore Procedures

CloudVPS Backup Manual. CloudVPS Backup Manual

Chapter 46 Terminal Server

Version Control with. Ben Morgan

Logic in Computer Science: Logic Gates

Transcription:

CSE 450 Translation of Programming Languages Lecture 3: Git Setup and More Lexing

Lecture Overview Git version control SSH keys Continuous Integration with Travis CI Walkthrough on git setup on CSE servers More Lex RegEx Review

Why do you need to know git for CSE450 Because you will be turning in your projects with it The only way to submit your projects (on time or late) is to push the code to your private GitHub repository

Better Reasons Collaboration Storing Versions Restoring Previous Versions Understanding What Happened Backup

Git and versions

Staging area http://gitscm.com

Demonstration of making a commit

BRANCHES AND COMMITS

Demonstration of Branches and merging

What command do you use to view commits? git commit git lg git status git log

Remotes

Lecture Overview Git version control SSH keys Continuous Integration with Travis CI Walkthrough on git setup on CSE servers More Lex RegEx Review

SSH Keys (Public / Private Keys) Authentication is annoying (typing in usernames and passwords) Doubly so when you need to do it often (like when using git) SSH keys provide a safe alternative to usernames and passwords After the one-time setup, you never need to type in your GitHub password into the terminal again

Public and Private Keys Remote Server Local Computer http://www.spirecast.com/wp-content/uploads/ 2009/06/public-key.gif

What does the remote server (e.g. github.com) need to authenticate you? Public Key and Private Key Just Public Key Just Private Key Username and Password

Lecture Overview Git version control SSH keys Continuous Integration with Travis CI Walkthrough on git setup on CSE servers More Lex RegEx Review

Continuous integration Travis CI provides a useful service: Continuous Integration After the setup, every time you push commits to GitHub, it will run the tests provided and report the results. You can configure Travis CI to email you this report. This is the only sure way to confirm you are passing the provided tests. http://www.mera.com/ services/processes/ integration

See Git Setup

Lecture Overview Git version control SSH keys Continuous Integration with Travis CI Walkthrough on git setup on CSE servers More Lex RegEx Review

Lecture Overview Git version control SSH keys Continuous Integration with Travis CI Walkthrough on git setup on CSE servers More Lex RegEx Review

Back To Ply tokens = ('WEEKDAY','WEEKEND', 'OTHER', "WHITESPACE") def t_whitespace(t): r'[\t\n ]' pass def t_weekday(t): r'''monday Tuesday Wednesday Thursday Friday''' print(t.value + " is a week day") def t_weekend(t): r'saturday Sunday' print(t.value + " is a week end day") def t_other(t): r'[a-za-z]+' print(t.value + " is not a day") data = ''' Monday Someday Tuesday Stop Saturday '''

Counting Words CHAR_COUNT = 0 WORD_COUNT = 0 LINE_COUNT = 0 tokens = ("word", 'eol', 'other') def t_word(t): r'[^ \t\n]+' global WORD_COUNT global CHAR_COUNT WORD_COUNT += 1 CHAR_COUNT += len(t.value) def t_eol(t): r'\n' global CHAR_COUNT global LINE_COUNT CHAR_COUNT += 1 LINE_COUNT += 1 def t_other(t): r'.' global CHAR_COUNT CHAR_COUNT += 1 data = """one two three """ # Build the lexer import ply.lex as lex lexer = lex.lex() # Give the lexer some input lexer.input(data) # Tokenize while True: tok = lexer.token() if not tok: break # No more input print(tok) print("line count = {}".format(line_count)) print("word count = {}".format(word_count)) print("char count = {}".format(char_count))

Lecture Overview Git version control SSH keys Continuous Integration with Travis CI Walkthrough on git setup on CSE servers More Lex RegEx Review

Designing Patterns Designing the proper regular expressions for patterns can be tricky, but you are provided with a broad range of building blocks.. A dot will match any single character except a newline. *,+ Star and plus are used to match zero/one or more of the preceding expressions.? Matches zero or one copy of the preceding expression. A logical 'or' statement - matches either the pattern before it, or the pattern after it.

Designing Patterns [ ] Brackets are used to denote a character class, which matches any single character within the brackets. If the first character is a '^', this negates the brackets, causing them to match any character except those listed. The '-' can be used in a set of brackets to denote a range. Escape sequences must use a '\'. ( ) Group everything within the parentheses as a single unit for the rest of the expression.

Designing Patterns {x} Match the preceding expression x times. {x,y} Match the preceding expression x to y times (x < y) ^ Matches the very beginning of a line. $ Matches the end of a line.

Example Patterns [0-9] A single digit. [0-9]+ An integer. [0-9]+(\.[0-9]+)? An integer or floating point number (always starting with a digit). [+\-]?[0-9]+(\.[0-9]+)?([eE][+\-]?[0-9]+)? Positive or negative integer, floating point, or scientific notation

More patterns... What regular expression can we use to detect comments? #.* What about literal strings? Does this work? ".*" What about: "[^"]*" No multi-line strings: "[^"\n]*" Allow escape chars: "([\n"] [^"])*"

Problems for you Give a regular expression that defines all email addresses? What sets of binary strings are defined by the following regular expression: 0 (0 1)* 0 (0 1)* 0 (0 1)* 0? 1+ ( 0? 1* )+

More problems for you Given the regular expressions: r1 = 0 (10)* 1+ r2 = (01)+ 0? 1.Find a string corresponding to both r1 and r2. 2.Find a string corresponding to r1 but not r2. 3.Find a string corresponding to r2 but not r1. 4.Find a string corresponding to neither r1 nor r2.