-
Notifications
You must be signed in to change notification settings - Fork 2
/
HOW_TO_USE.txt
81 lines (63 loc) · 3.36 KB
/
HOW_TO_USE.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# ecmaspeak-py/HOW_TO_USE.txt:
# Example commands for running the scripts in this repo.
#
# Copyright (C) 2018 J. Michael Dyck <[email protected]>
# (Although this file may look like a shell script,
# you shouldn't treat it as such.)
# The scripts in $EK communicate via a pickle-file ($D/spec.pickle).
# To ensure that spec.pickle has the required info,
# there are some constraints on the order in which
# you run the scripts.
# In this chart, each script is a 'child' of the script that it must follow:
#
# analyze_spec.py
# |- static_type_analysis.py
# You might wonder why there are multiple scripts.
# If I had a faster computer or a faster implementation,
# the various scripts would instead be modules of a single executable,
# which would simply recalculate things from scratch
# each time it was invoked, for whatever purpose.
# But as things stand, that would take too long.
# In particular, parsing_all_pseudocode and static_type_analysis.py
# take a while to run, so if I'm iterating on the latter,
# I don't want to wait for the former each time.
# ----
# These commands assume you're running from the main directory
# of the 'ecma262' repo (or a fork thereof).
# I.e., 'spec.html' is a file in the current directory.
# The location of the ecmaspeak-py directory:
EK=../ecmaspeak-py
# The scripts create a fair number of output files.
# To prevent them cluttering up the current directory,
# you specify (as the first arg to each script)
# another directory where they should all go.
# In the following commands, I use the shell variable $D for this.
# Specifically, `gcbn` returns git's current branch name,
alias gcbn='git rev-parse --abbrev-ref HEAD'
# so D=_`gcbn` makes a separate directory for each branch.
# (The initial underscore makes the directories easy to gitignore.)
# Because of the large amount of output,
# it isn't practical to examine it all after each run.
# So instead, I typically only look at the differences
# between successive runs.
# The scripts generate their output as foo.new,
# then the 'car' command shows the difference (if any) between foo and foo.new,
# and prompts me to accept the new file.
# (car is a symlink or alias of the compare_and_replace.py script:
# https://github.com/jmdyck/compare_and_replace.py)
# --------------------------------------------------------------------
D=_`gcbn` && $EK/analyze_spec.py $D spec.html && car -d $D msgs_in_spec.html ids pseudocode_{ambig,errors,prod_counts,parsed} sections record_schemas intrinsic_facts intrinsics intrinsics_anomalies emu_grammars_misc def_prodns approximate_annex_a grammar_lr step_refs static_deps optional_param_anomalies sdo_coverage oh_warnings header_info alg_anomalies
# (~ 7s)
# {lexical,syntactic}{A,B,J}_{min_len,firstk,expanded_grammar,automaton}
# {lexical,syntactic}_{min_len,firstk,expanded_grammar} syntactic_automaton
# SLR(1) machine constructed with 15822 states and 508 conflicts
# analyzing sections took 5.85 seconds
# If pseudocode has ambiguites:
csplit $D/pseudocode_ambig.new '/^(/' '{*}'
# then compare xx* to see where the problem is.
# --------------------------------------------------------------------
D=_`gcbn` && $EK/static_type_analysis.py $D
D=_`gcbn` && $EK/static_type_analysis.py $D && car -d $D unused_type_tweaks deps spec_w_errors spec_w_edits sta_misc
# (~ 23s)
# split_types
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX