Commit 2d0d8050 authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Add Pcbnew s-expression file parser.

* Add s-expression file parser object and keyword files.
* Fix minor issues with s-expression file formatting.
* Fix a minor bug the zone container fill state parsing in the legacy plugin.
* Move EDA_TEXT visibility definition to eda_text.h.
* Add minor BOARD_ITEM object improvements to support s-expression file
  parser.
parent de471744
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -30,3 +30,5 @@ new/sweet_keywords.cpp
new/sweet_lexer.h
bitmaps_png/png*
bitmaps_png/tmp
common/pcb_keywords.cpp
include/pcb_lexer.h
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
    // because all boards thickness no not match with this setup:
    // double epoxy_width = 1.6;    // epoxy width in mm

    g_Parm_3D_Visu.m_Epoxy_Width = pcb->GetDesignSettings().m_BoardThickness
    g_Parm_3D_Visu.m_Epoxy_Width = pcb->GetDesignSettings().GetBoardThickness()
                                   * g_Parm_3D_Visu.m_BoardScale;

    // calculate z position for each layer
+10 −0
Original line number Diff line number Diff line
@@ -121,6 +121,8 @@ set(PCB_COMMON_SRCS
    ../pcbnew/legacy_plugin.cpp
    ../pcbnew/kicad_plugin.cpp
    pcb_plot_params_keywords.cpp
    pcb_keywords.cpp
    ../pcbnew/pcb_parser.cpp
)


@@ -148,6 +150,14 @@ make_lexer(
    PCBPLOTPARAMS_T
    )

# auto-generate pcbnew_sexpr.h and pcbnew_sexpr.cpp
make_lexer( ${CMAKE_CURRENT_SOURCE_DIR}/pcb.keywords
            ${PROJECT_SOURCE_DIR}/include/pcb_lexer.h
            ${CMAKE_CURRENT_SOURCE_DIR}/pcb_keywords.cpp
            PCB
          )


# The dsntest may not build properly using MS Visual Studio.
if(NOT MSVC)
    # This one gets made only when testing.
+5 −1
Original line number Diff line number Diff line
@@ -354,7 +354,11 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
            // Add font support here at some point in the future.

            if( ( m_Size.x != DEFAULT_SIZE_TEXT ) || ( m_Size.y != DEFAULT_SIZE_TEXT ) )
                aFormatter->Print( 0, " (size %s)", FMT_IU( m_Size ).c_str() );
                aFormatter->Print( 0, " (size %s %s)", FMT_IU( m_Size.GetHeight() ).c_str(),
                                   FMT_IU( m_Size.GetWidth() ).c_str() );

            if( m_Thickness != 0 )
                aFormatter->Print( 0, " (thickness %s)", FMT_IU( m_Thickness ).c_str() );

            if( m_Bold )
                aFormatter->Print( 0, " bold" );

common/pcb.keywords

0 → 100644
+195 −0
Original line number Diff line number Diff line
#
# This program source code file is part of KiCad, a free EDA CAD application.
#
# Copyright (C) 2012 CERN.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
#

# These are the keywords for the Pcbnew s-expression file format.

add_net
angle
arc
arc_segments
area
arrow1a
arrow1b
arrow2a
arrow2b
at
attr
autoplace_cost90
autoplace_cost180
aux_axis_origin
blind
bold
bottom
center
chamfer
circle
clearance
comment
company
connect
connect_pads
crossbar
date
descr
die_length
dimension
drawings
drill
edge
edge_width
effects
end
feature1
feature2
fill
fill_segments
filled_polygon
fillet
font
fp_arc
fp_circle
fp_curve
fp_line
fp_poly
fp_text
full
general
gr_arc
gr_circle
gr_curve
gr_line
gr_poly
gr_text
hatch
hide
italic
justify
kicad_pcb
last_trace_width
layer
layers
left
links
locked
micro
min_thickness
mirror
mod_edge_width
mod_text_size
mod_text_width
mode
model
module
net
net_class
net_name
nets
no
no_connects
none
np_thru_hole
offset
oval
pad
pad_drill
pad_size
pad_to_mask_clearance
pad_to_paste_clearance
pad_to_paste_clearance_ratio
page
path
pcb_text_size
pcb_text_width
placed
plus
polygon
portrait
priority
pts
radius
rev
rectangle
reference
right
rotate
scale
segment
segment_width
setup
size
smd
smoothing
solder_mask_margin
solder_paste_margin
solder_paste_margin_ratio
solder_paste_ratio
start
status
tags
target
title
title_block
tedit
thermal_width
thermal_gap
thermal_bridge_width
thickness
top
trace_width
tracks
trace_min
trace_clearance
trapezoid
thru
thru_hole
tstamp
use_thermal
user
user_trace_width
user_via
uvia_dia
uvia_drill
uvia_min_drill
uvia_min_size
uvia_size
uvias_allowed
value
version
via
via_dia
via_drill
via_min_drill
via_min_size
via_size
virtual
visible_elements
width
x
xy
xyz
yes
zone
zone_45_only
zone_clearance
zone_connect
zones
Loading